Reading HTML Email with Mutt

Mutt is my new favorite productivity tool. I have been blazing through my emails and setting up custom macros and commands like crazy. I have have found myself optimizing mutt more than actual reading email since it makes checking email go by so fast. Like Vim I would say mutt has dramatically changed the way I do things.

One of the things I get a little annoyed by is emails written in HTML. I have no need for images and other garbage filled emails. I would say 90% of the emails that contain HTML are spam; however, I occasionally I needed to read those HTML emails.

The only thing you have to do for Mutt to read HTML is tell it which browser you want to open.

Setting it all up

 
First install Links2 with your distro’s package manager.

apt-get install links2

Then create a file called, .mailcap in your home directory with the following lines:

text/html; links2 %s; nametemplate=%s.html
text/html; links2 -dump %s; nametemplate=%s.html; copiousoutput

This will tell mutt to open the html files with links2 and then dump them back to the screen. This is handy so you don’t have to open the full links2 browser.

Then add this to your .muttrc:

auto_view text/html

Now when you go to read an email with HTML you should be able to see it without all the markup.




1 Response to "Reading HTML Email with Mutt"
  1. Why I Use Mutt on August 4th, 2008

    [...] for attachments. You can configure mutt to open html emails with any type of text browser such as, lynx, links, w3m, or links2. You can open word/pdf documents [...]

Leave a reply