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.
Tagging a Batch Queue

So, what is all this tagging about? Mutt allows you to tag messages that you then can act on in one fell swoop. Think of it as a batch queue. Press T to tag messages into the queue, or use T to tag using regular expression matching. Then, use ; to prefix any command normally available to a single message, and all tagged messages will be affected in a batch.

Figure 6. Tagging Mail Matching a Regex

Once messages are tagged, press ;-D to delete all tagged messages, ;-F to flag and so on. Again, pressing ? shows all available keystrokes. Imagine how quickly you now can delete the hordes of unread mailing-list messages.

Compose and Send

Now, let's send a test message using the Gmail SMTP server. Press M to compose an e-mail message. Fill in the To: line, then the Subject: line. Your e-mail editor opens automatically. Write your message, save and quit. You will see a page that allows you to edit the Cc, Bcc and other fields. Finally, press Y to send the message.

Figure 7. The Final Screen before Sending Mail in Mutt

Address Book

Need an address book? No problem. By default, Mutt has support for alias, or contact, files. To start using aliases, create an empty ~/.mutt-alias file, then source and reference it inside your ~/.muttrc. Press A to save contacts while using Mutt. You can access contacts using Tab from the To, Cc or Bcc entry fields:

source ~/.mutt-alias
set alias_file=~/.mutt-alias

Alternatively, you can use abook. By design, the abook address book program integrates with the Mutt e-mail client. Install abook using your standard distribution tools, or compile the source code available at abook.sourceforge.net.

Set up a macro for A that calls abook. Macros are powerful tools in Mutt. They can pipe data into shell scripts or executables and allow for the customization of any keystroke:


set query_command= "abook --mutt-query '%s'"
macro index,pager A "<pipe-message>abook --add-email-quiet<return>" 

With the new macro in place, press A to add a contact into your address book. You can query the abook contacts using Q.

Editors

Like most Linux power tools, Mutt is specialized. It manages e-mail very well and lets other programs worry about most of the rest. Editors and spell-checkers live outside of Mutt.

I prefer to use Vim. But, do you want to use GNU Emacs, GNU nano or another editor? Simply set it as your editor inside ~/.muttrc. By default, Mutt uses the $EDITOR environment variable if no editor is defined.

For spell-checking, I like Vim's spell-check as-you-type feature. Use these settings in your ~/.vimrc to underline misspelled words in red:

set spell
set spell spelllang=en_us
set spellfile=~/.vim/spellfile.add

highlight clear SpellBad
highlight SpellBad term=standout ctermfg=1 
highlight SpellBad term=underline cterm=underline
highlight clear SpellCap
highlight SpellCap term=underline cterm=underline
highlight clear SpellRare
highlight SpellRare term=underline cterm=underline
highlight clear SpellLocal
highlight SpellLocal term=underline cterm=underline

Once Vim's spell-checking is enabled, you have these options available to you when your cursor is over a misspelled word:

  • zg to add a word to the word list.

  • zw to reverse.

  • zug to remove a word from the word list.

  • z= to get list of possible spellings.

And, Much More

Mutt has too many interesting features to outline in the scope of one article. However, one last feature I want to share with you is the bounce command. Bounce lets you resend a message to a new recipient. The message arrives at the new recipient from the original sender, not the bouncer. Why is this useful? Well, what if a ton of e-mail was sent to your work address instead of your personal e-mail address? Don't just forward the messages in bulk—bounce them. First, tag all the messages you want to bounce by pressing T and providing a regex search string that matches your selection. Use the sender's name, for example. Then, act on the queue by pressing B. Fill in your personal e-mail address, and press Enter to execute the bounce.

______________________

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.

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