How do I see the text/html version of an email?

Todd Zullinger tmz at pobox.com
Sun Apr 23 16:50:18 UTC 2023


José María Mateos wrote:
> On Sun, Apr 23, 2023 at 02:56:35PM +0000, Alan Mackenzie wrote:
>> Some considerate organisation has been sending me MIME mails with
>> content in a text/html section and a wholly blank text/plain version.
>> What I see in mutt is the blank text/plain.  Who on Earth thought a
>> blank text/plain section was somehow a good idea?

[I know, I know, I'm answering a rhetorical question.]

I suspect one likely group would be the companies who depend
on advertising revenue.  With HTML, they can stuff tracking
(whether direct like hidden pixels or indirect by changing
any URLs in the message to go through their servers.  Those
things aren't very useful in text/plain, so shipping a blank
part just forces many folks to view the text/html.

Of course, sending just text/html would work better -- but
who knows what goes on in the minds of people willing to
perform shady tracking. :)

> I've seen a worse version of this: the text version and the html version are
> completely different.
> 
> On my side, I have this:
> 
> auto_view text/html
> folder-hook . 'unalternative_order *; alternative_order text/plain text/html'
> folder-hook boletines 'unalternative_order *; alternative_order text/html text/plain'
> 
> So normally I look at the plain-text version, except in my folder
> "boletines" (Spanish for "newsletters"), where I default to HTML.
> 
> In those cases where I'm in another folder and I need to look at the HTML
> content, I use this macro:
> 
> macro index,pager ,b "<view-attachments>/html<enter><view-mailcap><exit>" "View first HTML attachment in browser"
> 
> This opens the first available HTML attachmend (typically the message body)
> in my browser of choice (set up via ~/.mailcap).

An alternative (or addition) to the above is a message-hook:

message-hook ~A 'unalternative_order "*"; alternative_order text/enriched text/plain text'
message-hook '~C "misbehaving-group at example\.com"' 'unalternative_order "*"; alternative_order text/html'

Replace ~C with ~f or other pattern as needed.  You may
need to add something like:

    auto_view text/html text/htm message/html message/htm

to the configuration as well, if you want them to open in
the mutt pager rather than in a browser.  I only view html
via plain text, so I set auto_view as-needed.

-- 
Todd
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.mutt.org/pipermail/mutt-users/attachments/20230423/cccfaacf/attachment.asc>


More information about the Mutt-users mailing list