The Beginner's Guide to the Mutt E-Mail Client


  1. Why should I bother learning mutt?
  2. How do I start mutt?
  3. How do I navigate in mutt?
  4. How do I read my e-mail?
  5. How do I compose a new e-mail message?
  6. How do I reply to someone's e-mail message?
  7. How do I sort my messages?
  8. How do I delete e-mail I no longer want? What if I accidentally delete a message I wanted to keep?
  9. How do I forward a message to someone else?
  10. How do I postpone a message?
  11. How do I send an attachment?
  12. How do I read an attachment?
  13. How do I change to a different mail folder and why would I want to?
  14. How do I quit mutt?
  15. What do all these index columns/letters beside my e-mail mean?
  16. Help! I've done something wrong and I don't know how to go back!
  17. Where can I get more information?

1. Why should I bother learning mutt?

Being text-based, mutt is not as pretty as the graphical e-mail clients most people are used to. However, once you are familiar with it, it is much faster and more flexible. In addition, it helps you get used to the text-based nature of the UNIX environment, which is what you'll be using in other Computing Science courses.

This mutt tutorial is for beginners. Some people have more experience with computers and UNIX than others, so we've assumed that the people using it are unfamiliar with both UNIX and with mutt. If you happen to be fairly comfortable with this sort of thing, set up mutt, then go to More Information and look up some of the mutt web pages.

2. How do I start and set up mutt?

If you are in the first-year Windows labs, find the "Read Mail" option on your start menu:

This will open up an ssh session to the ohaton server. You will need to log in using your Computing Science user name and password:

Every once in a while, usually when we do a server upgrade, you will get a message upon login that looks much like this:

  The authenticity of host 'ohaton.cs.ualberta.ca
  (129.128.41.238)' can't be established.
  RSA key fingerprint is
  a7:70:a6:4c:94:7b:04:27:2e:fe:3e:e9:22:7f:51:4d.
  Are you sure you want to continue connecting (yes/no)?

What this means is that the security key on the server has changed and your account still contains the old one. Just type in yes and press [enter], and you should be able to continue logging in.

If you log in correctly, you will get a UNIX window and a prompt that says:

username@ohaton:~> 

Congratulations! You can now run mutt. If you've done this before, type mutt at the command prompt and press [enter]. If this is your first time, you can make things easier on yourself by doing a couple of things first. Press [enter] after every command.

First, type ls at the command prompt. This will list the contents of your account, like so:

You're looking for a file called Mailbox. When e-mail arrives, it all goes into the Mailbox file automatically. The program that delivers the mail will create a Mailbox for you if one isn't there. If you haven't received any e-mail, though, there will be no Mailbox and mutt is going to complain. Nobody wants whiny software, so you're going to create one. To create a Mailbox file, use the touch command:

This will create an empty Mailbox for you. If you ever accidentally remove your Mailbox or it mysteriously goes away, you can make a new one by using this method. UNIX is case-sensitive! Mailbox and mailbox are two different files, please don't mix them up.

Next, copy over .muttrc, the mutt default configuration file. It contains a bunch of settings which do things like tell mutt which mailbox file to use. Type the following:

username@ohaton:~> cp /usr/local/rcfiles/Muttrc ~/.muttrc

Mutt is now a little more user-friendly. To start mutt, type mutt at the command prompt. It may ask you whether to create a Mail directory:

Press y. This is where your other mail folders will live.

3. How do I navigate in mutt?

Once you start mutt, it will display a list of all the e-mail messages in your default mailbox. If you don't have any e-mail, the index will be empty. You'll have to skip ahead and mail a few messages to yourself before you can navigate them.

Anyway, this list is called the index, and will look much like this:

What does this all mean? Look here for a more complete explanation.

The convenient menu bar displays the commands you are most likely to use. The current message is highlighted. If you want to select a different message, you can do one of several things.

First, you can use the up and down arrow keys to move up and down the index one message at a time. Don't use the arrow keys on your number pad! They don't work. You can also use the j and k keys to move up and down, but most people don't unless they lose their arrow keys.

You can use the left and right arrow keys to move up and down one page at a time, if you have a lot of e-mail.

You can move directly to a message you want by typing the number of the message and pressing [enter].

You can use * to go to the very first message and = to go to the last message.

Last of all, you can search for a word or phrase by subject or sender of a message by using / (forward slash) and [esc]/. For example, if you were looking for a message from someone named Amanda, you would press /, type Amanda, and press [enter]. This would take you to the next message that had Amanda as either the subject or the sender. If that's not the message you were looking for, press n to continue the search. When the search reaches the end of the mailbox, it will wrap around to the beginning and continue from there. Pressing [esc]/ does the same thing as /, except it searches backwards instead of forwards.

All commands are case-sensitive! N and n do two different things, so be sure you don't accidentally have the [caps lock] on, otherwise mutt might do something unexpected and irreversible.

4. How do I read my e-mail messages?

Assuming you have started mutt and are in the index, highlight the message you want to read and press [enter]. Mutt will display the message. The display environment is called the pager.

You'll notice that the bar at the top now has a different list of commands. Press the key listed to run that command: press i (for index), q (quit) or x (exit) if you want to go back to the index of messages.

[Space bar] will display the next page of the message you're reading while - will display the previous page.

Press j to go to the next message in the list. Hitting [space bar] over and over will also take you to the next message once you reach the end of the one you're currently on.

5. How do I compose a new e-mail message?

You can start a new e-mail message by pressing m. At the bottom of the window, it will display a "To:" prompt, where you will type the address of the person you're trying to e-mail. Press [enter] and it will prompt you for the subject of the message. Press [enter] when you're done. Now, mutt will launch a separate text editor:

The text editor is a completely different program from mutt. Mutt is helpful in that it lets people use whatever editor they feel the most comfortable with. Your default editor should be EMACS and it should look like the screenshots above. Because doing almost anything in UNIX requires some familiarity with a text editor, it's worthwhile to learn how to use one. EMACS is fairly easy and straightforward if the menus are functional (window mode) and incredibly unhelpful if the menus are not functional (no-window mode). When using the "Read Mail" window, EMACS should open up in window mode by default. You should be able to use the menus to save, exit, copy, paste, etc. If you ever find yourself in need of an EMACS guide, you can look [here] for a reference to some of the more common EMACS shortcuts.

Type your message in the editor window. You'll probably need to press [enter] at the end of each line to prevent the message from being one single enormous line. If your message already IS one enormous line, you can press [esc]q to format it into a paragraph. Your cursor needs to be somewhere on the line you want formatted.

Once you're done editing the message to your satisfaction, use the File menu to Save and then Exit. This will exit the editor and put you back into mutt, where you should see something like this:

From this menu, you can do a number of useful things. The top bits (under the menu commands) are your message headers. If you notice that you made a mistake in typing out the recipient's address or the subject, now is your chance to fix things. If you look at the convenient command list at the top of the window, you can press t to edit the "To:" header and s to edit the "Subject:" header. If you would like to carbon-copy this message to a bunch of friends, you can press c to add their addresses. Just type out their addresses on one line, putting a comma after each address.

If you want to send your message, press y. If you want to cancel or postpone the message, or send an attachment you can look up attachments and postponing messages in this tutorial.

6. How do I reply to someone's e-mail message?

You can reply to the message from either the index (list of messages) or the pager (reading the message). First, select the message you want to reply to. Then hit r to reply. Mutt will ask you to confirm the recipient and subject of the message. Press [enter] to leave them as they are or edit them and press [enter] when you're done editing. Mutt will also ask you whether to include (quote) the message you are replying to. If you press y, the editor will start up with a copy of the message and an attribution:

You can edit this any way you like.

If not, the editor will start with a blank message. Either way, editing and sending is exactly the same as if you were composing a new message. If you need to, look at the sending messages portion of the tutorial. Ignore the first paragraph. Everything else should be relevant.

Sometimes, you will be one of many recipients of a message. If you want to reply to everyone at once, instead of replying by pressing r, press g (for group-reply) instead.

7. How do I sort my messages?

You can sort your index of messages in several different ways. If you press o, this will display a number of sorting options at the bottom of the mutt window:

You can sort by date; alphabetically by sender, recipient or subject; by thread; by the size of the message or by the score of the message (if you customized mutt to score your messages). The most common/useful sorting methods are by date and by thread. The thread sorting method collects all the messages with the same subject into a thread like newsreaders do, so it's easy to find all the replies to every message. Each thread is then organized by date, based on the first message in the thread.

8. How do I delete e-mail I no longer want? What if I accidentally delete a message I wanted to keep?

You can delete a message from either the index (list of messages) or the pager (reading the message). First, select the message you want to delete. Then hit d to mark the message for deletion. It doesn't actually get deleted unless you exit mutt, switch to a different mail folder or force the mailbox to sync by hitting $. At that point the changes get written to the disk and your message is gone.

You'll notice that the message marked for deletion is marked with a D in the index, and when you use the arrow keys to select messages mutt will automatically skip over messages marked for deletion.

If you accidentally marked the wrong message for deletion, you can unmark it as long as you can still see it in the index. If the changes have been written to disk, the message is gone. If the message has sat in the Mailbox overnight, you may be able to get it restored from backup. Look [here] for information on backups and restore requests or go to the Helpdesk (CSC 1-43).

To unmark a message that is still in the index, type the message number (the leftmost column in the index) and press [enter] to select the message, then hit u to undelete the message.

9. How do I forward a message to someone else?

If you've received something interesting in the mail and you want to pass it on to someone else, select the e-mail message you want to forward and hit the f key. Type the e-mail address of the recipient. The message will then open up in its own editor window, where you can do basically the same things that you would do when replying to an e-mail message.

10. How do I postpone a message?

If you are interrupted in the middle of editing a message or decide to put off sending it for some reason, you can put the message on hold and continue editing it later. Save and exit the editor just as you would if you were sending the message right away. Instead of pressing y to send the message, press q to quit. Mutt will ask you if you want to postpone the message. Press y to do so. When you come back later and want to resume the message you were typing, press m to mail a new e-mail message. Mutt will ask you if you want to recall the postponed message. Press y and you will be able to continue editing it.

11. How do I send an attachment?

Say you want to attach an assignment to an e-mail message. For the purposes of this example, I will use the file file.txt in the directory assign1 in my home directory.

You will need to either compose a new message, reply to a message or forward a message. If you're composing a new message but want to leave the body of the message blank, you will have to type something (even [space] or [enter]) and save, because mutt will automatically cancel a completely empty message. Once you get to this window:

press a to add an attachment. You can now add an attachment in one of two ways: if you don't know where the file is, you can press ?. This will let you navigate your files and directories (folders). The window should look something like this:

By default, you start in your Mail directory. file.txt is not in my Mail directory, so I will have to browse out of Mail and into my home directory.

The rightmost column is the file or directory name. Use the arrow keys to navigate to the file or directory you want. .., the first entry in the list, is the parent directory (.. is shorthand for the directory that contains the one you're in). If I select .. and press [enter], the browser will take me back one directory, which happens to be my home directory. Then I want to find assign1. I use the arrow keys to select it and [enter] to open it. I select file.txt, and I press [enter] to attach it. If I select a file, pressing [enter] will add that file to my e-mail as an attachment. If I select a directory, pressing [enter] will open it. How do you tell the difference? If you look at the directory listing:

1   drwxr-xr-x   20 root     other         512 May 17 15:15 ../
2   drwx------    2 test07   ugrad         512 Sep  3 15:23 Mail/
3   -rw-------    1 test07   ugrad        2356 Sep  3 15:23 Mailbox
4   -rwxrw----    1 test07   ugrad         600 Sep  2 16:21 PUTTY.RND*
5   drwx------    2 test07   ugrad         512 Sep  3 15:18 assign1/
6   drwxr-xr-x    2 test07   ugrad        1024 Sep  3 16:09 screenshots/

You will notice that the directories have two differences. One is that the directory name is followed by a /. The other is that in the second column, where you see the group of dashes and letters (ie: drwx------), the listing for a directory will start with a d while that of a file won't.

So I've added file.txt to my e-mail, but it took a bunch of browsing. I knew where the file was in the first place, so I could have done this a lot more easily.

If you know where your file is, you can skip all the browsing. After you press a to attach a file, and mutt asks you which file you want to attach, instead of pressing ? you can just type out the path of the file and press [enter]. Using my example, my path would look like this (and yours will look similar):

~/assign1/file.txt

The ~ is shorthand for your home directory (your H: drive in Windows). The above path means that in my home directory there is the directory assign1 and inside that there is a file, file.txt. If I moved file.txt out of assign1 and into my home directory, and then wanted to attach it, the path would look like this:

~/file.txt

When you've selected/typed in the file you want to attach, it will appear in the send menu:

From here, you can attach another file using the same method, send your file or postpone the message, same as any other message.

12. How do I read an attachment?

Sometimes people will send you e-mail with attachments. (Of course, some of those people are viruses. The nice thing about UNIX is that most e-mail viruses fail, but still there's no need to go around opening suspicious attachments.) If you get an e-mail with an attachment and read the e-mail, it will have a line underneath the headers saying something like:

[-- Attachment #1 --]
[-- Type: text/plain, Encoding: 7bit, Size: 0.2K --]

If you want to look at the attachment/attachments, press v. This will take you to an attachment menu that looks much like this:

From here, use the up and down arrows to select the attachment you want to look at and press [enter] to look at it. Here, the first one is the text of the e-mail message and the second is the attachment.

The attachment may call up a new window (if it's not text) or you may need to save it and look at it in a different program. To save it, press s. Mutt will ask you what file you want to save it to. The default will be whatever the attachment is called. You can edit it if you want. Press [enter] to save the file.

If you want to go back to the index, look at the convenient menu bar at the top for the relevant command. It will be either i or q, depending on which menu you are in.

13. How do I change to a different mail folder and why would I want to?

Your main mail folder is Mailbox. This is where all your arriving e-mail goes. However, you also have a Mail directory where you can put other mail folders. You can use mutt quite happily without ever making another folder or looking inside your Mail directory. However, mail folders can be useful so the information is here if you ever want to use it.

The first and most useful thing is that there's already a folder in your Mail directory. It's called sent-mail and it contains all the e-mail YOU have sent to other people. Every time you send a message to someone, a copy of it is put into your sent-mail folder. This is useful for all sorts of things, including looking up whether you sent a message to someone and forgot about it.

I'm going to use sent-mail as an example for how to access a folder. Say you sent a message to your friends to meet you somewhere before a concert you were all attending. One of them didn't show up, and later said you never sent the message. You think you included him in the message, but you can't really remember. So you decide to check your sent-mail folder to see what happened.

In your index, you press c. Mutt will ask you which mailbox you want to open. You can open the mail folder you want in one of several ways. If you know the name of the folder, that's the easiest. In this case, the name of the folder is sent-mail, so you can type:

=sent-mail
and mutt will open the sent-mail folder for you. Sometimes, mutt is busy loading new e-mail messages into the Mailbox. If it's doing that, it may ignore your request to change to another mail folder. If that happens, just type the commands in again and it will eventually work.

The = sign in front of sent-mail is shorthand for the Mail directory, or wherever your folders live.

If you don't know what your folder is called, you will have to browse through your account until you find it. When mutt asks you which mailbox you want to open, press ?. This will open up a directory browser. Mutt will automatically open the browser to the Mail directory. If you keep all your folders in the Mail directory, then all you have to do is use the up and down arrow keys to select the mail folder you want and press [enter] to open it.

Whatever folder you open will look and work pretty much the same as your normal folder, Mailbox. You can navigate it the same way, read messages the same way, reply to yourself or forward the messages to someone else. If you want to delete messages from the sent-mail folder, you can. They will be gone forever (see deleting messages). The sent-mail folder is nothing special.

So you find the message to your friends and resolve the argument. Now you want to go back to reading your regular mail. Press c to change mail folders. Now, you can browse back to the Mailbox the long way, but there is a shorter way to do things. The Mailbox is your default mail file, so it's special. When mutt asks you which mailbox to open, you can type > and press [enter]. This will take you right back to your regular old Mailbox.

You can also organize your mail into folders you make yourself. Say you want to save mail you get from your professor to a folder called professor. The easiest way is to highlight the message in your Mailbox index, and press s. Mutt will ask if your want to save the message to a mailbox. It will most likely supply a name for the mailbox based on the name of the sender. However, you can change that. Press [backspace] to delete the default name and type in

=professor

If you have not created a professor mail folder before, mutt will ask you if you want to create the folder. Don't be confused if it asks you something like:

Create /home/dsk27/ugrad/yourname/Mail/professor? ([yes]/no):

that is the full path of your account. As long as the last three things are your username, Mail and whatever folder you are trying to create, then mutt is putting the folder in the right place. Press y to create the folder. The message you save will be marked for deletion in your Mailbox, and the new folder will with the message in it will be created. You can try to go to the new folder the same way you went to sent-mail.

If you have created the folder before, mutt will save the mail to the folder with no more fuss.

14. How do I quit mutt?

If you want to quit mutt and save all the changes you made to your Mailbox (have it delete the messages you wanted deleted, mark the messages you already read as being read), then press q to quit. If for some reason you don't want to save any of the changes, then press x to quit.

After you have quit mutt and gone back to the prompt, type exit or logout to close your ssh session. After that, you can close all the windows.

15. What do all these index columns mean?

This is your index. It's full of letters and arrows. What the heck does it all mean?

So the columns labelled above are:

Status flags:

16. Help! I've done something wrong and I don't know how to go back!

If you've accidentally hit the wrong key and mutt is doing something you don't want it to do, there are several ways to get mutt back on track. If mutt hasn't launched an editor window yet, you can usually get out of a command by hitting [control] g. If you hit a key like o, for example, but don't want mutt to sort your mailbox, instead of picking one of the sorting options you can press [control] g and cancel the request. [Control] g will usually only work if mutt has paused and is asking you to type something or choose an option.

If you're stuck in a menu you don't recognize and don't want to be in, try pressing q or i. Those will usually take you back to the index. If you just want to exit mutt and not save any changes, press x.

If you're in the editor and have accidentally started an e-mail message you don't want to send, quit out of the editor. If you didn't save any changes to the message, mutt will automatically cancel the message. If you have made some changes and saved them, you will get the send-message menu. Instead of pressing y to send the message, press q. Mutt will ask you if you want to postpone the message. Press n and the accidental message will be gone forever.

17. Where can I get more information?

This is just a very basic guide to get you started using mutt.

The first place to try getting information is to press ? in mutt. This will display a (large) list of commands. The leftmost column is the key combination and the rightmost is a description of the command. Some will be more familiar than others. Press space bar to scroll through the list. At the end, it will kick you back to your regular mutt menu.

Next, there are a couple decent resources on the Internet where you can get much more information:

You can also go to the Helpdesk in CSC 1-43 if you are having problems, but please make an effort to look up the information yourself. We don't know mutt like the manual knows mutt. The more comfortable you are looking things up online, the more you'll know about the software you use and the more useful mutt will be.