I am not a fan of HTML email, but it has become pretty much a standard for business correspondence, invoices, etc. Mutt's ability to utilize a mailcap file is a good solution, allowing you to open an HTML email in an external browser, but it does not account for the lazy and/or clueless companies that distribute email in HTML-only messages, instead of doing The Right Thing™ and sending a multi-part message with plaintext and html parts. Getting these messages to play nicely in Mutt takes a bit of work, but is not that difficult. With a few minor configuration tweaks, the following setup can be achieved:

  1. Multi-part messages with both text/plain and text/html parts will display the text/plain message part.
  2. Single-part text/html messages will be passed through a text web browser to be rendered to plaintext.

In either case, it will still be possible to go to the Attachments view and open the message in an external browser.

The first thing that must be done is to add the following to your .muttrc:

# Sanely handle multi-part messages (prefer text part, but yield to
# mailcap-configured rendering for html-only)
alternative_order text/plain text/html
auto_view text/html

The alternative_order option tells Mutt to prefer the text/plain part when rendering a multi-part message, while the auto_view option will make Mutt pass text/html message parts to the command defined in your mailcap file to render them to plaintext.

The next part is to setup mailcap entries. If you don't already have a file called .mailcap in your home directory, create one and add the following lines:

text/html;  /usr/bin/firefox %s >/dev/null 2>&1; needsterminal
text/html;  elinks -dump %s; nametemplate=%s.html; copiousoutput

The first of those two entries will be used for viewing the message in an external program (in this case Firefox). The second entry will be invoked by Mutt's auto_view to render the message and display it in plaintext. I'm using elinks here, but other text web browsers are capable of performing the same "dump" action as well.

And that's really all you need to do. With these tweaks, even HTML-only email will look nice in Mutt, and you'll still have the flexibility of opening the message in a GUI web browser if you desire.