[LinuxBrit]

Mutt

For those of you who are already sold on mutt, here's a copy of my ~/.muttrc and my /etc/Muttrc to check out, maybe some stuff you wanna pinch...

I highly recommend you check out my procmail page, and my .procmailrc, as I use mutt with procmail, and it really is the best way to handle mail.

For the rest of you, you're gonna get a tour. Some people try mutt and are scared off, because the default settings aren't always the most friendly, and don't demonstrate all the cooler features of mutt :)

Mutt does threads, that's a good place to start. I subscribe to a number of mailing lists, and mutt is ideally suited to handling their traffic, in combination with procmail.

Let's start with a screenshot. This is mutt's index view. It shows a list of the mails in a mailbox

mutt

So. The first thing you should note is that this index format is customisable. It can show whatever you want in the order you choose. Notice the colour coding. This is totally user-definable. In this example, (my muttrc settings), emails from me are bright cyan and marked 'F', emails to me (To: or Cc:) are bright green and marked 'T', and I even highlight my cvs commits in blue :)

The colours give a nice clear view, for quick reference. Here is another mailbox, to show some other features.

mutt

In this example, you can see I use two types of new mail. Unread and new mail is coloured yellow. Mail that has just arrived is marked 'N', and mail that is old but unread is marked 'O'. This is a great way to keep track in mailing lists.

Also note the threading. Threads are collapsable, as you'd expect, and there are two types of threading. I employ both in my muttrc. Strict threading is the plain lines and arrows, and is used for mails that have a correct "In Reply To:" header set (ie. good mail software), and unstrict threading is used for broken mailers like Pine :) These are matched using subject line comparison, and marked with a broken (asterisked) line and arrow.

Okay, so let's read some mail with mutt then :)

mutt

I use the line:

set pager_index_lines=9
in my muttrc. This shows me 9 lines of the index when I read mail, so I can see the thread context. You can see it at the top there...

See the colour coding? You can define what email headers are shown to you, and in what order in the muttrc. They can be coloured as you choose. Not also that quoted text is hilighted, using different colours for each level. Makes reading lots of quoted text much nicer.

i.e.

color WHERE FOREGROUND   BACKGROUND REGEXP

There are hilighting shortcuts too, like these:

color index brightgreen  default    ~p    # To me (personal)
color index yellow       default    ~N    # New
color index yellow       default    ~O    # Old

Okay. Like I said, I subscribe to a number of mailing lists, and use procmail to sort the mails from these into different folders in my ~/mail directory. Now to use mutt to navigate between them.

I have redefined all the normal mutt movement keys, as they're a huge pain in the ass :) I like to use the arrow keys to browse my mail, and these keybindings let me do it all using one hand:

bind  pager   <up>     previous-line
bind  pager   <down>   next-line
bind  pager   <left>   exit
bind  pager   <right>  view-attachments
bind  attach  <left>   exit
bind  attach  <right>  view-attach
bind  index   <right>  display-message
macro index   <left>   "c?"
bind  browser <right>  select-entry
bind  browser <left>   exit

So by simple pressing <left> from the index view, I get to the directory view, shown here:

mutt

Again, this view is totally customisable. It shows a list of the mailboxes in my mail directory, showing their sizes, and marking boxes containing new messages with 'N'. By pressing the tab key, I can limit the view to only those mailboxes specified as active in my muttrc:

mutt

All I do is use the arrow keys to select the box I wanna view and press <right> to open it.

Here's a truly great thing about using mutt. I can run it in an Eterm, to get a nice transparent background, and when I send a message, I can type it in vim =)

mutt

That's what composing a message looks like, because, of course, vim knows how to colour emails too :)

If you wanna know how to do something in mutt, drop me a line. In the meantime, I'll put up more mutt info when I get the time...