Re: URLs screwed in the mail body
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Sunday, March 9 at 01:58 PM, quoth Francis Moreau:
> My last example of screwed URL has been sent by outlook.
> format=flowed was not set.
Ahh, yeah, then you're screwed.
>> Yeah... unfortunately, that macro (I've been trying it all
>> yesterday) doesn't *quite* work on all emails. Lynx sometimes gets
>> confused by the message headers, I think.
>>
>
> But doesn't pipe_decode, when set, remove them ?
True, but if pipe_decode is set, mutt will feed the message through
(in the case of html emails) your mailcap before piping it to where
you want. Piping pre-rendered html text to lynx won't achieve
anything.
I use, for example, w3m to render auto_view html emails. w3m does a
great job, but doesn't collect all the URLs into a list at the end of
the email (like lynx or links would do). Piping the output of that
(which is what happens with pipe_decode set) through urlview usually
results in urlview not finding any URLs, for obvious reasons. If I
have pipe_decode unset, however, mutt doesn't even decode
quoted-printable encoding, so the URLs can be really badly mangled ---
and unfortunately, even lynx can't help with that.
A better solution would be to have pipe_decode set and then use lynx
for doing auto_view html rendering. But that doesn't address URLs that
have been mangled with format=flowed wrapping (and, in my personal
opinion, w3m does a better job of rendering html).
>> I just put together a perl script that would do the trick instead of
>> lynx. It's attached.
>
> Sorry but I don't speak perl, so I can't comment. I'm wondering if
> sed + a good regexp could do the job instead.
It would have to be a pretty complicated sed script. One of the big
benefits of my perl script there is that it handles all the possible
quoted-printable encoding and even possible Base64 encoding---which
would be pretty hard to do with a sed script. The other problem with a
sed script is that it can't detect the difference between
format=flowed emails and non-flowed emails (or the difference between
delsp=yes and delsp=no). My perl script, on the other hand, can. Which
is not to suggest that it's perfect... but, for an afternoon's worth
of hacking, I think it does a pretty good job fixing all the problems
I've had so far. :)
~Kyle
- --
Holding on to anger, resentment and hurt only gives you tense muscles,
a headache and a sore jaw from clenching your teeth. Forgiveness gives
you back the laughter and the lightness in your life.
-- Joan Lunden
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!
iD8DBQFH1Jr+BkIOoMqOI14RAlBFAKDth9Ew7mKyLpLX7wlK3fumLxGF2gCcDBn9
alIPiKfEecQ4M1YNIZqjouk=
=zjxK
-----END PGP SIGNATURE-----