<<< Date Index >>>     <<< Thread Index >>>

Re: Hex encoded mailto: tags problem



On 10/06/04 21.30, Stephen Stocker wrote:
>   Hi,
> 
>   I've been trying to get Mutt working as the mailer for Elinks, but
>   I've got something set up wrong. The problem is that addresses in the
>   mailto: URI on many mailing lists are hex-encoded, and that's what
>   Mutt puts in the "To:" field.
> 
>   An example is:
>     <A 
> HREF="mailto:elinks-users%40linuxfromscratch.org?Subject=%5Belinks-users%5D%20Some%20subject&In-Reply-To=Pine.LNX.4.58.0406061016510.9927%40hdtl";
>        TITLE="[elinks-users] Some subject">somebody at somewhere.com
>        </A><BR>
> 
>   So, when I hit the link to send a reply, the "To:" header in Mutt
>   appears as:
> 
>   "elinks-users%2540linuxfromscratch.org@xxxxxxxxxxxxx" (My computer
>   name plus domain name).

Well, how about just wrapping mutt in a script? So instead of 'mutt
<addr>' you would have 'elinks-mutt <addr>'. Elinks-mutt would look
something like this:

  #!/usr/bin/env bash
  adr="$(echo $1|perl -pe 's/%(\d\d)/sprintf "%c", hex $1/eg')"
  exec mutt "$adr"

Note that only one address is handled, adding more is left as an
exercise to the reader.

also note that mutt takes '-s <subject>' as argument, so something
like:

  if [ -n "$2" ]; then
    sub="-s \"$(echo $2|perl -pe 's/%(\d\d)/sprintf "%c", hex $1/eg; s/\"//')\""
  fi
  exec mutt $sub "$adr"

should handle optional subject as second argument. I hope this helps
you get started, but please make sure what you end up with works (try
from the commandline), I've not actually tested this.

/dossen
-- 
Common sense is the collection of prejudices acquired by age eighteen.
                -- Albert Einstein

Attachment: pgpfVchiJzkUy.pgp
Description: PGP signature