Some notes on computer stuff code tags rss about

Prefer plain text format over HTML in mutt

July 22, 2014
[mutt] [mail] [issue]

Although this subject is covered in multiple sources, it's hard to find it for some reason or at least it wasn't that easy for me. That's why I repeat it once again here and provide links to more verbose explanations.

What is it for

Some people/e-mail clients do not provide plain text versions of their messages, which is inconvenient if at least one of recipients uses something like mutt to read e-mails. Fortunately, mutt is smart enough to be able to convert such e-mails to plain text format on the fly (via auto_view option and mailcap_path option with mailcap file). The issue is that once automatically viewing of HTML is set up mutt starts to open HTML version of e-mails even when there is plain text version available. HTML converted to text lacks hyper-links to follow using something like urlview and, in general, doesn't make much sense, plain text suits for emails better than HTML.

Really short answer

Use alternative_order setting. Excerpt from man muttrc:

alternative_order type[/subtype] [ ... ]
unalternative_order [ *  | type/subtype] [...]

alternative_order command permits you to define an order of prefer‐
ence which is used by mutt to determine  which  part  of  a  multi‐
part/alternative  body  to  display.   A subtype of “*” matches any
subtype, as does an empty  subtype.    unalternative_order  removes
entries  from  the ordered list or deletes the entire list when “*”
is used as an argument.

Like this:

auto_view text/html
alternative_order text/plain text/html

More details