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.

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState