[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: "mailto:" + EXTERN wishlist [lynx-dev]
From: |
Klaus Weide |
Subject: |
Re: "mailto:" + EXTERN wishlist [lynx-dev] |
Date: |
Fri, 11 Jun 1999 02:44:38 -0500 (CDT) |
On Thu, 10 Jun 1999, Michael Warner wrote:
> On or about 10 Jun, 1999, Louis-David Mitterrand
> <address@hidden> wrote:
>
> > On Thu, Jun 10, 1999 at 02:41:41AM -0500, Klaus Weide wrote:
> > > For mailto links, EXTERN ('.') can be used:
> > >
> > > <http://www.flora.org/lynx-dev/html/month0299/msg00474.html>
> >
> > That's nice. I just mapped:
> >
> > EXTERNAL:mailto:mutt %s:TRUE ## mutt is a popular mail client under unix
> >
> > It would be absolutely perfect if the "mailto:" prefix did not appear
> > in %s and if the "subject?" field that can be added to mailto: links
> > would be passed as %S for example.
>
> When in doubt, wrap it!
Yes.
> I've got:
>
> EXTERNAL:mailto:${HOME}/bin/scripts/lxmail.sh %s:TRUE
>
> where lxmail.sh is the very minimal:
>
> #!/bin/sh
> #lxmail.sh called by lynx external for mailto:'s receives
> #'mailto:address@hidden' as it's argument, chops off the
> #'mailto:', and passes the address to an email program.
> ADD=`echo $1 | cut -f2 -d:`
> ${HOME}/bin/mutt ${ADD}
>
> , and I imagine some modification might even let you deal
> with the "?subject"-type variations.
Try this, if your /bin/sh understands the ${parameter#word} and
${parameter%word} syntax (it works fine for me with bash, but is
broken with my version of /bin/ash):
--------------- snip ---------------
#! /bin/sh
#lxmutt.sh called by lynx external for mailto:'s receives
#'mailto:address@hidden' as it's argument, chops off the
#'mailto:' and subject if present, and passes the address and subject
#to an email program (here, mutt).
MAIL_PRG=mutt
#Note: URL-escaped characters in mailto-URLs are NOT handled correctly.
#
URL="$1"
RECIPIENT="${URL#mailto:}"
STRIPPED_RECIPIENT="${RECIPIENT%%[?]subject=*}"
if [ "$STRIPPED_RECIPIENT" = "$RECIPIENT" ]; then
$MAIL_PRG "$RECIPIENT"
else # "$STRIPPED_RECIPIENT" != "$RECIPIENT"
SUBJECT="${RECIPIENT#*[?]subject=}"
$MAIL_PRG -s "$SUBJECT" "$STRIPPED_RECIPIENT"
fi
--------------- snip ---------------
> And thus perhaps we might approach absolute perfection in an
> imperfect world.
Not perfection, since %XX isn't unescaped and other xxx=yyy pairs
aren't handled.
Also it doesn't handle a subject given by
<A HREF="mailto:..." TITLE=subject>.
> PS. There are also some environmental variables set by lynx
> that might be useful, but I don't know whether/how they
> could be used with EXTERN. The (most easily found)
> documentation only seems to mention PRINTER: and lynxcgi
> use, I think. See:
>
> lynx_help/keystrokes/environments.html
None of that seems to apply for EXTERN.
Klaus
- lynx-dev Eudora with Lynx ???, Frederic Schwebel, 1999/06/08
- Re: lynx-dev Eudora with Lynx ???, David Woolley, 1999/06/10
- Re: lynx-dev Eudora with Lynx ???, Klaus Weide, 1999/06/10
- lynx-dev "mailto:" + EXTERN wishlist (was: Re: Eudora with Lynx ???), Louis-David Mitterrand, 1999/06/10
- Re: "mailto:" + EXTERN wishlist [lynx-dev], Michael Warner, 1999/06/11
- Re: "mailto:" + EXTERN wishlist [lynx-dev],
Klaus Weide <=
- Re: "mailto:" + EXTERN wishlist [lynx-dev], Mike Castle, 1999/06/11
- Re: "mailto:" + EXTERN wishlist [lynx-dev], Vlad Harchev, 1999/06/12
- Re: "mailto:" + EXTERN wishlist [lynx-dev], Klaus Weide, 1999/06/12
- Re: "mailto:" + EXTERN wishlist [lynx-dev], Vlad Harchev, 1999/06/12
- Re: "mailto:" + EXTERN wishlist [lynx-dev], Klaus Weide, 1999/06/12
- Re: "mailto:" + EXTERN wishlist [lynx-dev], Vlad Harchev, 1999/06/12
- Re: "mailto:" + EXTERN wishlist [lynx-dev], Klaus Weide, 1999/06/12
- Re: "mailto:" + EXTERN wishlist [lynx-dev], Vlad Harchev, 1999/06/13
- Re: "mailto:" + EXTERN wishlist [lynx-dev], Klaus Weide, 1999/06/14
- Re: "mailto:" + EXTERN wishlist [lynx-dev], Vlad Harchev, 1999/06/14