Mutt: An introduction

Mutt is a relatively new and well-supported mailreader for the UNIX shell, created by Michael Elkins to address some of the common complaints about Elm.

The controls are very similar to those in Elm; if you're familiar with Elm, you should be able to get up to speed on Mutt in no time. There are many customization hooks and features in Mutt, far too numerous to list here.

If you want more information about it, you might start by looking at the official Mutt website. That page includes many helpful links that will help introduce you to mutt.

Mutt is very friendly to advanced users; however, it's not quite as friendly to beginning UNIX users as Pine. If you find Mutt a bit daunting and bothersome, we suggest trying Pine instead.

Like all other UNIX packages on Panix, Mutt has a manpage too. You can reach it by typing man mutt at a UNIX shell prompt.

Using Mutt on Panix

Mutt has very good support for both Maildir and IMAP, which makes it an excellent choice for our mail system. Its one drawback is that there's no support for Pine-style folder collections; the folder browser can be set to your old-style Mail directory _or_ your new Maildir/IMAP folder list, but not both. However, you can easily use the "-f" option to read folders in either place (and in either format).
Your INBOX:

Your INBOX is in maildir format; Mutt can tell this by itself, so you don't need to worry.

If Mutt has trouble seeing the INBOX now, first make sure that your $MAIL environment variable is not set incorrectly. Depending on your previous configurations, it may still be pointing to your old-style ".mailspool" directory. Unset the $MAIL variable and you should be fine.

Is that all?

If you don't want to use IMAP or Webmail, and just want to keep using Mutt the way you always have, you can stop here.

In fact, if your Webmail/IMAP use will just be a matter of peeking in your INBOX occasionally while traveling, you can stop here too. Your INBOX is always visible in Webmail and IMAP.

But, if you want to see your other IMAP folders in Mutt's folder browser or to see your Mutt folders in IMAP and Webmail, it gets more complicated.

Seeing IMAP/Webmail folders in Mutt:

There are three ways to view an IMAP/Webmail folder in Mutt. Here they are:

  1. Tell Mutt the exact folder name
    If you press c to change folders, and then type the exact path of the folder, Mutt will open that folder. This path can either be a UNIX path to the maildir folder, or a URL for the IMAP folder. Folder names are case sensitive.
    So, if you have an IMAP folder called Foo, you would press c, then type either:
    ~/.maildir/.Foo
    or
    imap://localhost/INBOX.Foo
    This method is great if you just need to look in an IMAP folder once in a while.
  2. Set the Mutt "folder" variable for IMAP

    If you don't need to see the old-style mail folders in your ~/Mail directory, you can tell Mutt's folder browser to use IMAP instead. This way, when you press c and then ?, Mutt will give you a list of your IMAP folders. Also, you can use the usual equals-sign shorthand to refer to mail folders.

    In your .muttrc file, look for the "folder" variable. Set it this way: set folder=imap://localhost/INBOX. (Don't forget the dot at the end. It's important.)

    This is also useful if you decide to convert all your old ~/Mail folders into IMAP/Webmail folders (see the next section), and no longer need to look in ~/Mail for them.

  3. Set the Mutt "folder" variable for direct maildir access

    This makes for a messier and harder-to-read folder listing than #2 above, but it means folders with lots of messages will open faster. Your choice.

    In your .muttrc file, look for the following variables, and change them as follows:
    set folder=$MAIL
    set mask="."
    set mbox_type=Maildir

    Now when you press c and ? to list your folders, you'll see a listing of your .maildir directory. The files beginning with a dot are your folders; feel free to ignore the courierimapuiddb and other such files without dots in front. They're not mail folders.

    You can still use the equals-sign shorthand for folders with this method, but you must remember to include the initial dot in the folder name. So instead of =Foo, you'll need to type =.Foo.

Seeing Mutt folders in IMAP/Webmail:

Your old-style Mutt folders are stored in "mbox" format, which IMAP and Webmail cannot read. All is not lost, though! Panix provides a utility that you can use to convert mbox folders into the IMAP-friendly Maildir format. It's called mb2md (and stands for "mbox to maildir").

The mb2md utility is in /usr/local/bin/, which should be in your $PATH.

Mutt usually saves mbox folders in ~/Mail, so we'll use that for our example. Using the example folder named Foo again, here's how you'd convert it so IMAP can read it:
mb2md ~/Mail/Foo ~/.maildir/.Foo
Basically, the syntax is
mb2md (sourcefile) (destination).
Pretty simple. Pay attention to the destination name, though!

To be visible in IMAP and Webmail, a maildir folder must:

Now your "Foo" folder will be useable in IMAP and Webmail. (Though you will have to subscribe to it first.) Voila! Of course, now you'll need to point Mutt at the IMAP folders (see previous section above).

Oh, one last thing... mb2md leaves the source file intact, so don't forget to remove the old mbox folder after you've checked that the new one works. And it merely appends to the destination folder, so if you run it twice with the same parameters you'll get two copies of everything.



Last Modified:Wednesday, 30-Jan-2013 12:14:06 EST
© Copyright 2006-2011 Public Access Networks Corporation