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

Re: URLs screwed in the mail body



On Saturday, March  8 at 02:10 PM, quoth Francis Moreau:
Actually it would be better to fix the source of the problem instead of trying to find a workaround... But I don't know where these URLs get splitted at first. Perhaps you could enlight me ?

Well, the SMTP RFC specifies a recommended maximum line length of 78 characters, and a hard limit of 998. If a URL is longer than 78 characters, many email clients will split the URL.

One way that it's sometimes done, for example by Apple's email client, is as a format=flowed email with delsp=yes. What that does is allows them to indicate (with a single space at the end of the broken line) that the next line should be appended without a space separating them.

 macro pager \cb "<pipe-message>tr -d ' \r\n' | urlview<enter>"

 The second option seems to be the best... but it has the problem that
 it may concatenate urls that shouldn't be concatenated (For example,
 imagine the sentence "Go to http://www.google.com/ and tell me what
 you think" - the url would become
 http://www.google.com/andtellmewhatyouthink

Why in this case spaces would be deleted ?

That's what `tr -d` does: it deletes all the characters you specify. In that macro, I specified three characters: a space, a carriage return, and a newline. The reason I specified a space is because of Apple's format=flowed trick.

What I wish we could do is use mutt to decode format=flowed and quoted-printable without having it feed things to the standard mailcap program when pipe_decode is set.

 Perhaps it's better to do this:

     3. Pipe it through lynx to extract the urls before piping it to
        urlview, like so:

        macro pager \cb "<pipe-message>lynx --force-html --dump | 
urlview<enter>"


Yes. It would be nice to apply this macro for html emails only. For text emails just do the usual/fast thing.

Thank you for your usefull feedbacks.

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.

I just put together a perl script that would do the trick instead of lynx. It's attached.

~Kyle
--
Only the fool hopes to repeat an experience; the wise man knows that every experience is to be viewed as a blessing.
                                                       -- Henry Miller

Attachment: extract_url.pl
Description: Perl program

Attachment: pgphIbISn6aHM.pgp
Description: PGP signature