reading HTML mails in mutt

I've been reading HTML mails in mutt for quite some time with html2text because I prefer its output over that from lynx, elinks, or w3m (although the latter is not bad either). today I stumbled over a QP-encoded UTF-8 HTML mail and learned that html2text fails with UTF-8.
to cut the story short, here's my solution:

# ~/.muttrc
# nothing new here

auto_view text/html
alternative_order text/plain text/enriched text/html text
# ~/.mailcap

text/html; iconv -c -f %{charset} -t LATIN1//TRANSLIT | html2text -style pretty; copiousoutput; description=HTML Text

# other options
# text/html; w3m -I %{charset} -T text/html -dump; copiousoutput; description=HTML Text
# text/html; lynx -dump -force_html -assume_charset %{charset} '%s'; copiousoutput; description=HTML Text; nametemplate=%s.html
# text/html; elinks -force-html -dump '%s'; copiousoutput; description=HTML Text; nametemplate=%s.html

gregoa, 2008-11-24

Creative Commons License
All material on this blog — unless stated otherwise — is © gregor herrmann, and is licensed under the Creative Commons Attribution-Share Alike 3.0 Austria License.