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

Re: URLs screwed in the mail body



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Friday, March  7 at 10:26 AM, quoth Francis Moreau:
> So my problem is that I often receive emails including some URLs. 
> But they're usually not displayed in one line but splitted into 2 
> parts. Then if I want to call urlview to extract URLs out of the 
> mail (^B), it only use the first part leading to a wrong URL.
>
> It usually happens with emails written in HTML.
>
> Could anybody tell me what's the best way to fix this.

I can think of two ways, both have their flaws.

     1. You can set pipe_decode before piping the message to urlview;
        that way mutt will reconnect all the lines according to the way
        they were encoded, and URLs won't be split. On the other hand,
        if you use w3m as your html renderer, many URLs will simply not
        be visible to urlview.

     2. Pipe it through tr to removes all newlines and spaces before
        piping it to urlview. Like this:

        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

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>"

~Kyle
- -- 
Last comes the beverage of the Orient shore, Mocha, far off, the 
fragrant berries bore. Taste the dark fluid with a dainty lip, 
Digestion waits on pleasure as you sip.
                                                        -- Pope Leo XII
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!

iD8DBQFH0Wa3BkIOoMqOI14RAn0PAKCWANOrXkyrh/dUVjDp2xqXDxOYhwCePaKM
C/G+eK4SM/C6fWi3QponBPI=
=mFwO
-----END PGP SIGNATURE-----