On 5 Sep 2026 21:20 +0200, from [email protected] (José María Mateos):
> I have this in my ~/.mailcap:
>
> text/html; w3m -I %{charset} -o display_link_number=1 -cols 72 -T text/html
> -dump ; copiousoutput
>
> It uses w3m to inline the HTML render of the message. Other people prefer to
> use lynx or links or whatever.
Similarly for Lynx:
text/html; lynx -width=$COLUMNS -dont_wrap_pre -dump -force_html -localhost
-assume_charset=%{charset} -display-charset=utf-8 %s; copiousoutput
This assumes that your terminal uses UTF-8 and wraps the message at
roughly terminal width.
I also have a macro:
macro index <f3> '<enter-command> auto_view
text/html<enter><enter><enter-command> unauto_view text/html<enter>'
which basically lets me display the HTML part on demand instead of
each time. There's probably a cleaner way to do that too but this
works for me at least. (In pager just add an <exit> at the beginning.)
> You'll also need this in your .muttrc:
>
> alternative_order text/plain text/html
> auto_view text/html
>
> This tells mutt to prefer plain text over HTML, but if there is only HTML
> present, render the text/html part (according to the .mailcap instructions).
Word of caution: some particularly broken senders send _different_
content in the text/plain and text/html parts in multipart/alternative
mail, beyond just the "your mail client can't read this mail"
text/plain part. This obviously isn't supposed to be done, but I
_have_ seen it on occasion, particularly with newsletters.
--
Michael Kjörling
🔗 https://michael.kjorling.se