Swarthmore College Department of Computer Science

What is Mutt?

Mutt is an electronic mail program you can use on the CS computers to access your CS email.

Taken from the My first mutt web page:

Mutt is a powerful, configurable, modern mail user agent for Unix-like systems such as GNU/linux, BSD Unix or Apple OS-X. You should consider switching to mutt when you need to:

Mutt has no pull-down menus or buttons to point-and-click at. Navigating around the various parts of the program means learning a few keyboard shortcuts (but the most important ones are usually displayed on the screen for you, so you don't need to remember them).

How do I start mutt?

On the command line, type mutt

$ mutt

If you have email, an index of messages will be displayed, with options for dealing with them at the top of the screen, and useful information at the bottom of the screen.

How do I enter addresses for sending mail?

Separate each one with a space or a comma.

$ mutt knerr holman

After the above command, mutt will ask you to confirm the addresses, enter a subject line, and then put you into a text editor to enter your message. After entering your message and saving and quitting, mutt will display the headers of your soon-to-be-sent email, and some options at the top of the screen. Enter y to send, q to abort, or other options to re-edit, change the subject or recipients, etc.

If someone else has a CS account, do I have to type out their username AND "@cs.swarthmore.edu"?

No. Just type their username then press Return. It will add the @cs.swarthmore.edu for you and fill in the person's full name as listed in the "users" file. However, if it is a non-CS address, maybe a swat one, it will add the same ending. So only do this with CS user names. In the examples below, the first one sends mail to knerr's CS account, the second one to knerr's swarthmore account, and the third one to a nonexistent account (jknerr1@cs.swarthmore.edu):

$ mutt knerr
$ mutt jknerr1@swarthmore.edu
$ mutt jknerr1

Can mutt remember other addresses?

Yes! Mutt has an address book. While you are viewing an email from someone, hitting the a key tells mutt you want to set up a permanent alias for the sender. You can also add aliases to your .muttrc file with any text editor, using the following format:

alias simpsons bart, lisa, homer, marge, maggie
alias krusty Krusty the Clown < krusty@hotmail.com >

Can I view HTML e-mails in mutt?

Mutt will not view html emails like mozilla thunderbird or other browser-like email applications, but there are ways to either start a browser or convert the html email to text. I use a script called demoroniser.pl and html2text to convert html emails to text. I've got this in my .mailcap file:

text/html; /home/knerr/bin/demoroniser.pl -q -w0 '%s' | /usr/bin/html2text -width 90 -style pretty; copiousoutput; description=HTML Text

Putting the following line in a .mailcap file runs lynx on html attachments:

text/html; lynx %s

How do I send attachments in mutt?

Just before you send a message, hit the a key, and mutt will ask you for a filename to include the contents of as an attachment. You can use Tab completion while entering the filename, and entering ? allows you to look at and navigate a list of files.

How do I open attachments in mutt?

While reading the message, hit the v key to see a list of attachments. Use the arrow keys and Return to select the attachment you want to view (or s to save it to a file).

How do I delete old mail?

Hitting the d key when you are reading a message will mark it to be deleted.

How will I remember all these commands?

You don't have to. I don't think I've ever read the mutt man page looking for an option. The most important/frequently used options are on the screen, and hitting the '?' key lists all of the other options (and you can search through this list by hitting the '/' key, typing some text, and hitting Return).

Can I customize mutt?

Yes. Here is a sample .muttrc file, which would go in your home directory:

#
# .muttrc
#
set folder = ~/mdir               # where all the mail folders are
#set arrow_cursor                 # use -> as cursor instead of hilighting line
set delete = yes                  # purge deleted messages without asking
set edit_hdrs                     # let me edit headers when composing
set copy = yes                    # always save a copy of outgoing messages
set record = +sent                # location to save outgoing messages
#set include                      # always include message when replying
set indent_str = " >> "           # how to indent replied text
set print_cmd = "enscript -2rhj"  # command to print messages
set print=ask-yes                 # default answer for print command
set sort = threads                # primary sorting method
#
# aliases
alias simpsons bart, lisa, homer, marge, maggie
alias krusty Krusty the Clown < krusty@hotmail.com >