Mutt: rendering html emails using w3m

htmlmutt

I occasionally receive html messages and I would like to see whether text has been formatted or colored by the sender. I can simply navigate to the attachment list and open the text/html MIME type attachment with a web browser; however, for the sake of simplicity, I would prefer for the html to be rendered as formatted text within the pager. To do this, I have enabled html rendering by w3m with the following line in my .muttrc file:

auto_view text/html.

Additionally, I have added to my config file lines such as the following to highlight text that the sender may have designated as important:

color bold brightred default.

I expect that any text that was formatted as bold by the sender will appear as brightred in the pager. However, this formatting is not actually applied. Instead, I see only plaintext preceded by the statement:

[-- Autoview using /usr/bin/w3m -I 'ISO-8859-1' -dump -T text/html ''/tmp/mutt.html'' --].

What am I doing wrong? How do I enable display of html-formatted messages within pager?

Best Answer

Mutt does not parse HTML. If you turn off HTML viewing, you won't see HTML content. Many mailers generate MIME multipart messages, with the same text present twice: once as an HTML part (text/html), and once as a text part (text/plain). The text part is mostly or completely devoid of formatting; some mail programs generate ASCII representations of emphasis *like* *this*.

The bold color setting is used by Mutt's built-in parser for text/enriched. Few programs send text/enriched content, so you're probably seeing a plain text part, with no formatting.

If you turn on automatic HTML viewing, then mutt isn't doing the displaying. W3m handles the formatting, and it always displays bold as bold.

Related Question