Penguin
Note: You are viewing an old revision of this page. View the current version.
"All mail clients suck. This one just sucks less." --Michael Elkins, original author of Mutt

Mutt is a popular console-based email client. Recent versions support things like IMAP, SSL and TLS as well as gpg(1) (see GPGMailClients).

Its greatest strength is an unsurpassed support for dealing with MailingLists. The threading is very smart, and it actually understands the notion of a MailingList: the list-reply command addresses a reply to a list post to the list but not its sender, avoiding cumbersome reply-to-all fiddling, and will not be confused by ReplyToMunging some evil mailing list software does either. There are many commands to allow you to efficiently select a large number of mails to operate on. Just about everything is customizable - keybinds, screen layout and colourization (including text highlighting in the pager), even the headers of all mail you generate. You can also edit all headers on the fly and individually for each mail. All of this functionality can also be bound to keys, making it simple to have an arbitrary number of mail adresses, mail servers, display configuration and anything else you can think of available at the touch of a key. It has superb support for sending mail from the CommandLine, even with attached files.

If you like this kind of power and freedom, Mutt is your mailer of choice.

Naturally, you pay a price for so much goodness: the learning curve is relatively steep, esp since the default configuration is just barely usable, forcing you to claw through much of the documentation in order to achieve a comfortable environment. Those who are willing to invest the effort however will find themselves pleasantly surprised. No other mailer enables you to deal with high mail volumes even nearly as efficiency.

Unsurprisingly, it's very fast and takes very little memory (unlike, say, MozillaMail). Being a console program (can be linked against either S-lang or Curses) it is naturally very usable even across a SSH connection on a dial-up. Unlike PINE, it is available under the GPL.

Hints and Tips

See .muttrc for example config files.

If you actually want to read any html email you get, you can get mutt to delegate arbitrary mime types to other programs (it will default to your pager for text/* types). Add the following line to your .mailcap file
text/html ; lynx -force_html %s

A more "integrating" alternative is to add set implicit_autoview to your .muttrc and make the .mailcap line something like

text/html ; lynx -force_html -dump %s ; copiousoutput

This will cause Mutt to transparently invoke lynx(1) and display its output in the integrated pager for any HTML message. (set implicit_autoview enables this for all MIME types with a copiousoutput keyword.)

Incidentally, vilistextum is an excellent tool for such on-the-fly conversion of HTML, as it launches and runs nearly instantly even on old and aging machines, where lynx takes its sweet time.

Automating messages with Mutt

If you want to send a message with Mutt with an attachment, like you would with mail(1), use
mutt -a $FILENAME -s $SUBJECT $TO < /dev/null

cat'ing a file into mutt doesn't seem to work the same way.

Mutt (and most other command-line mail programs) take std input to be the body of the message. That won't work if you expect it to add all the nice MIME headers and stuff for attachments.

Forcing headers

When you're root and you are just using mutt to remail things (see above) you might want a more descriptive from line than "root": add

my_hdr From: test@example.org set realname="Real Name"

to /.muttrc

Using maildir

If you use Maildir format mailboxes (for example, Courier IMAP) and you want to read them locally with Mutt
export MAIL=/Maildir/
and insert the following line into .muttrc
set folder=/Maildir/