next up previous contents
Next: Dealing with Attachments Up: Configuring Mutt Previous: General Settings   Contents


Dealing with HTML Messages

Let's start with HTML. Mutt alone doesn't handle HTML text on its own, but since the console web browser lynx does, we can leverage its power to filter out the HTML markup and present it to us in text format. This is extremely useful. To do this, as well as deal with other attachments, we need to create a .mailcap file in our home directory that lists possible MIME types (attachment types) and how to deal with them. Your .mailcap file is a simple text file and may already exist in your home directory, depending on your distribution. If it does exist, simply add the following line:
text/html; lynx -dump -force_html  %s;  needsterminal; copiousoutput

Once your .mailcap tells mutt how to process HTML files, you must tell mutt to first source the .mailcap, and second to process the HTML and present it inline, instead of treating it as an attachment to be shown separately. This takes away the HTML mystery of your friends who insist on using hotmail: mutt will filter out the text and simply present it without the formatting. If you respond to or forward the message, the text will remain and the formatting will be permanently removed. People who tend to gravitate towards console email clients tend to like this ability to strip out all extraneous formatting that makes email large and unwieldy. Once you've modified the .mailcap file, add the following lines to your .muttrc:

set implicit_autoview
auto_view text/html  application/x-pgp-message
set mailcap_path="~/.mailcap"

The first line tells mutt to automatically show everything it knows how to show without being prompted, the second line tells mutt which types of files to show as part of the body text, and the third line tells mutt where to find the mailcap.


next up previous contents
Next: Dealing with Attachments Up: Configuring Mutt Previous: General Settings   Contents
Randall Wood 2009-12-02