Power Up Your E-Mail with Mutt

Tired of your e-mail client hogging all your system resources? Experience the low-cost power of Mutt.

Finally, I also configure my ~/.mailcap file so that Mutt knows with which applications to open HTML e-mail, PDFs and images. I use w3m to auto-view HTML inline with Mutt. You also can use ELinks or Lynx:

text/html; echo && /usr/bin/w3m -dump %s; nametemplate=%s.html; 
application/pdf; /usr/bin/evince %s
image/jpeg; /usr/bin/display %s
image/gif; /usr/bin/display %s
image/png; /usr/bin/display %s

You are ready! Save all configuration files and run mutt. You will have to accept a security certificate from imap.gmail.com. If you choose to save the certificate, it will be saved in ~/.mutt_certificates.

Put Down the Mouse

The keyboard is your friend. Mutt is great for laptop users, because the heavy lifting is done by typing, not clicking. All the power of Mutt is yours without ever taking your hands off the keyboard.

Pressing Enter opens an e-mail message, the I key returns you to the mailbox's index. Use the arrows to move around, and press Q to quit just about any screen.

From the index, use Tab to skip to the next new messages, D to delete, F to flag and so forth. The top bar in your display will show some commonly used keystrokes. Enter ? to see the full list of available commands.

Color settings in Mutt are particularly useful in the index view. If you use the color settings from my example .muttrc, all new messages are displayed in green, flagged messages are displayed in yellow, deleted messages are red and tagged messages are purple (more on tagging later).

Figure 1. Mutt's Colors in Action

Sort and Search

Now that you have access to your IMAP account and can send e-mail, here are some shortcuts for managing your Inbox. These shortcuts are the seductive draw of Mutt. You can zip through your e-mail quickly without ever touching a mouse.

First, you can sort and order your email by date, thread and many other fields by pressing O. Set the default sort method in .muttrc using set sort. I prefer to sort by threads (set sort=threads), then date (set sort_aux=date).

Figure 2. The Sort Options Available in the Index View

Sorting your Inbox by threads opens a new group of commands that apply to entire threads. For instance, if you want to delete an entire thread, use Ctrl-D while highlighting any e-mail in the thread. Delete large threads of e-mail with one keyboard stroke.

For a more concise view, limit your view to a subset of messages with the limit command, L. You can limit to unread, read, flag and more. All the standard sorting and tagging commands work when in a limited view. If you want to see your entire Inbox again, limit to all.

Figure 3. Mutt's View Limited to New Messages

Want to search for a message in your Inbox? If you are familiar with Vim, searching through e-mail in Mutt should be second nature. Simply press / as you would in Vim, and tell Mutt your search string. Searches take the form of regular expressions, so regex to your heart's desire!

Figure 4. Searching for Messages in Mutt

Speaking of regex, you can delete, flag or tag using regex as well. For instance, to delete all messages matching a pattern, press D. Fill in your regular expression match pattern and press Enter. With only a few keystrokes, you're done. Use F for flagging and T for tagging messages by regular expression matching.

Figure 5. Deleting Messages Matching a Regex



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.


Rany Albeg's picture

Finally a great article about this nice e-mail editor.GREAT JOB!!!!!


Ian MacGregor's picture

Thank you for this wonderful article. Your information allowed me to finish configuring mutt for myself and my friends.