Back to main page

The Quick-N-Dirty Guide to Mutt

The aim of these QND guides is to get you up and running quickly. Therefore, there is going to be little explanation of why things work. However, by the end of this article, you will be able to use mutt to send and receive email.

The easiest way to get mail in mutt is to use getmail. So, before starting this guide, take a look at the QND getmail guide. It will only take you a few minutes. Don't worry, we'll wait.

(The author greatly prefers getmail to the better known fetchmail. However, for those who must, there is also a QND Fetchmail guide.)

Now to set up mutt. Open up your favorite text editor and make a .muttrc file (note the dot before it).

folder-hook . "my_hdr From: John <john@isp.com>"

The example given is the absolute minimum for a .muttrc. There are often examples, and the references given below go into much greater detail.

Most distributions have a system wide /etc/Muttrc file. It's always good to take a look at that file to see what is there. (On some distros it's in /etc/Mutt/muttrc or something similar, but you should be able to find it.

Note that you don't have to have sendmail, postfix or whatever your MTA is running as a daemon to use mutt. Mutt will call it when necessary.
(Actually, in my experience, postfix can be iffy--sometimes it will work if postfix isn't started and other times it won't. I've also found that in FreeBSD, this doesn't seem to be the case. If sendmail isn't started, the messages will be queued but not sent. However, if you're using ssmtp as a sendmail replacement, done by typing make replace in /usr/ports/mail/ssmtp, you don't have to call it before sending mail)

Aliases

The aliases file is comparable to an address book. As this is the QND guide, we're only covering how to add an address of someone sending you mail.

Open up your .muttrc file and add these two lines

set alias_file=~/.mutt_aliases
source ~/.mutt_aliases

This tells mutt where to look for your aliases. This will serve as an address book. Now we create our .mutt_aliases file.

touch .mutt_aliases

Now, if you receive mail from someone and want to add them to your aliases, while on their email hit the a key. Mutt will begin a dialog. It's usually safe to accept the defaults save for the last question, which is something like save to /.mutt_aliases?
For that question, change it to ~/.mutt_aliases. If, however, it says save it to /home/john/.mutt_aliases then it's safe to accept it.

This should enable you to get mutt up and running. Mutt is a very powerful and configurable client and there countless other options. For further reading you can start with a more detailed page of mine and, of course, the mutt manual which should probably be on your machine in /usr/share/doc/mutt[version number]. It's also available on line here.

Back to main page