Power Up Your E-Mail with Mutt

 in
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; 
 ↪copiousoutput
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

______________________

Comments

Comment viewing options

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

THanks

Rany Albeg's picture

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

Awesome!

Ian MacGregor's picture

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

Webinar
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Webinar
Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix