[Techtalk] Mutt and html (was Large SAMBA-howto post)

Akkana akkana at shallowsky.com
Wed Jan 2 17:10:20 EST 2002

Jenn Vesperman writes:
> However, please treat this as a one-off, not as authorisation to start
> posting large HTML attachments. 
[ ... ]
> It will also annoy our large mutt-using contingent.

Not to disagree with your posting (I certainly agree with posting links
rather than long attachments), but I find that mutt does wonderfully at
displaying html attachments (which I get all the time since I work at a
company where html email is a big part of the corporate culture).

In my .muttrc, I have this line:
auto_view text/html

In .mailcap, I have these lines:
[ ... ]
text/html; mimehelper /usr/local/mozilla/mozilla -remote 'openURL(file://%s)'; nametemplate=%s.html
text/html; links -dump %s; nametemplate=%s.html; copiousoutput
[ ... ]

(I've also used lynx and w3m, but links is my current favorite.)

What this does: if an html attachment comes in, mutt automatically runs
it through links and displays it just like a normal plaintext message;
if I didn't notice the line that said it was doing that, I wouldn't
even know it was html.

On the rare occasions when that doesn't work (someone forwards a page
with complicated tables or links I need to click on or something),
I type 'v' in mutt, which shows me the attachment list; then I downarrow
to get to the html part, hit return, and mutt sends the html attachment
to my current open mozilla window (substitute netscape or your favorite
browser as desired).

The only thing mutt doesn't do right is multipart/related pages where
there's an html plus embedded images; I haven't found a way to get mutt
to handle that.

You could even set up mutt to handle MS word attachments, using catdoc
or word2x or a similar program, if you're plagued by people sending that sort of
thing (I seldom get them so I don't bother).

Oh, yes, mimehelper is a little script I wrote because sometimes the tmp
file doesn't stay around long enough:

#! /bin/sh -f
# Script to run xv or other programs from mailcap for mutt
# and other command-line mailers.
# Runs $argv[0] in the background, then waits long enough
# that the tmp file will have been read completely.
echo $prog $*
$prog $* &
sleep 6

More information about the Techtalk mailing list