November 12, 2003

Clean email - Part 2

In my previous article, I described how I go about filtering list messages to improve how my email and mailing list subscriptions are handled. I focussed on Procmail and a couple of simple recipes to clean things up a bit.

In this second episode, I will go on to describe my Mutt configuration, and how I have made it as smooth as possible an email client.

By default, mutt is very careful in its operation. It asks many questions when you try to do things, so a new user won't end up embarassing him/herself and pissing off other people. Each reply has the recipients verified, deleted messages are verified with questions, and most non-read operations are verified. Other features are turned on with the intention of minimising confusion for the new user.

However, I've been using Mutt for about 5 years now, and I can use it with full confudence and speed, without fear of doing something wrong. Thus I don't want anything slowing me down, but want to make the client as fast and pleasant for me as possible. So I took my hodge-podge of configuration snippets and random broken-ness and fine tuned it for myself. I hope that some of these tips will help other seasoned users to get the most out of the client.

You might wish to take a look at my .muttrc file and a screenshot to understand what I'm on about.


I like to navigate around quickly and with minimal keyboard traversal, so I added a couple of keybindings to facilitate this as well as a couple of other things:

bind index <pagedown> next-page bind index <pageup> previous-page bind pager <left> exit bind pager <delete> delete-message bind pager <pagedown> next-page macro index S "\ryd" # bounce message to spam learner

Most of these bindings allow me to browse email with one hand near the arrow keys, and the other on my coffee. The final one was mentioned briefly in my first article, and bounces the current message to the bayesian classifier, then deletes it. Using a normal pipe to sa-learn waits on the process, which can take up to a minute to perform. This one returns immediately.


Various formatting rules are setup to tidy things up a bit. I have eliminated a few parts of the display, electing to only see the bits that I need, letting me see them a lot faster.

# 185 + 27 Oct Ben Buxton (568K) FW: Veiligheid op het werk ... set index_format=" %3C %Z %{%e %b} %-13.13F (%4c) %-40.40s" # - - 182/196: Stansted Express Order Confirmation -- (93%) set pager_format="-%Z- %C/%m: %-20.20n %s" # --- /var/spool/mail/bb [196 messages, 7.2M] (date-received) set status_format="-%r- %f [%m messages,%?n?%n new,?%?d?%d del,?%?F? Flag:%F?% ?t? Tagged:%t?%?p? Post:%p? %l] %> (%s) "

By default, displaying a messages uses the entire screen for it. But by setting the pager_index_lines variable to something like 7, the first few (7) lines of the pager screen shows a small section of the message index. This makes thread navigation a lot simpler, as can be seen in the screenshot.

Colour is an important part of the setup, as it helps in distinguishing different parts of the display more easily. I have chosen for high contrast, yet non-disturbing colours for the display, to maximise visibility, but avoid eyestrain. For some semblance of aesthetics, I've used default for most backgrounds, to show my Eterm background image in most parts. My dark Eterm backgrounds prevent annoying colour contrast problems. I have also set a different colour on each level of quoting, enabling me to easily traverse replies in a message.

I also use colours for each message. In my main inbox, my email is coloured white for normal mail, cyan for new mail, and grey for list mail. This makes it easy to see at a glance what there is. For other mailboxes, I use white for read messages and cyan for new messages.

For a cleaner message display, I have set Mutt to only display a few lines of header for each message.

ignore * unignore from: date subject to cc hdr_order Date: To: CC: From: Subject:

Everything else is ignored. If I want to see the other headers, I can press 'h' to view them. Otherwise they take up valuable screen real estate, and the beginning of the body is often on a different line for each message, causing too much eye movement.


I make use of folder-hooks also. For my primary inbox, I have it set to sort by date-received. This puts the newest emails at the bottom, where I can see them all grouped together. List folders, on the other hand, are configured to display in threaded mode, given the nature of them.

Some of my miscellaneous settings speed things up, primarily by eliminating most of the confirmation questions. A few other little settings are described in my .muttrc.

With just these few small settings, I have made emailing a much more pleasant and slicker process, and highly recommend spending a few minutes ironing out your setup.

Posted by Ben at November 12, 2003 10:02 PM

Urghh..I'm choking with all the codes. Can you speak English? :P

Posted by: Snow at November 12, 2003 11:33 PM

You should not use this kind of feedback to spamassassin, because the headers of the bounced mail will be different (after being processed anothertime by the MTA) from the headers of the original mail.

You can set the following mutt macros (one for spam -false negatives- and other for ham -false positives-). There are two macros for each one because one is for the indexer (when you see the email-subject list) and another is for the pager (when you read the email):

# Tell SA the message should have been spam

macro index S "unset wait_key\nsa-learn --spam --single\nset wait_key\ns=spam\r"

macro pager S "unset wait_key\nsa-learn --spam --single\nset wait_key\ns=spam\r"

# Tell SA to train message as HAM

macro index H "unset wait_key\nsa-learn --ham --single\nset wait_key\ns=inbox\r"

macro pager H "unset wait_key\nsa-learn --ham --single\nset wait_key\ns=inbox\r"

All this will:
1- unset the wait_key: dont read the "wait for a key" phrase after processing the message and return directly to the indexer/pager.
2- sa-learn
3- set the wait_key
4- save the message in the proper box (your choice's name)

Posted by: mcm at April 24, 2004 03:25 AM
Post a comment

Remember personal info?

Recent Entries
- Linux on an HP Compaq NC6400
- Sodium in water? Bah..try Caesium!
- I'm off to Lugradio
- Food for thought...
- Replacing ugly Helvetica fonts in Xorg
Support me...

Email me:
NL time:21:10
Book: Assassini (Thomas Gifford)
Amazon wish list
Search the web