Power Up Your E-Mail with Mutt
E-mail—one of the Internet's first joys and evils. It brings us closer but forces us to weed through clutter, distractions and snake oil salesmen. Parsing and organizing the data is a tricky task. As with most jobs tricky and time-consuming, people marry a favorite tool. Presumably, you have an e-mail reader you hold dear to your heart. Nevertheless, I suggest you cheat on Thunderbird, Evolution or KMail for a day and experience the power of Mutt, the e-mail client underdog.
Mutt is a feature-rich, lightweight, text-based e-mail client. Yes, it's text-based. Don't let Mutt's simple presentation fool you. The text-based display is a feature, providing a customizable, concise viewport. The Mutt e-mail client will play nicely with remote IMAP, POP3 and SMTP servers. SSL connections also are supported. Whatever features Mutt does not provide, other tools, such as address books, Web browsers, document viewers and more, can be leveraged to enhance Mutt's innate abilities. So, why all the fuss when most e-mail clients can do the same? Mutt is faster, more customizable and less resource-intensive.
Need to sort quickly through hundreds of e-mail messages a day? Find that your current e-mail client takes up too much screen real estate? Maybe your e-mail client consumes too much memory? Do you want better e-mail threading for all those mailing lists to which you belong? Are you a system administrator who regularly needs a quick way to test e-mail servers? Tired of dealing with your laptop's mouse pad to read and send e-mail? Want to use Vim or Emacs to compose your e-mail? If any of these apply, Mutt will seduce you.
The first obvious advantage of Mutt is its small memory footprint. Below, I show the memory usage of KMail, Thunderbird, Evolution and Mutt on my system:
VIRT RES SHR %MEM COMMAND 156m 37m 19m 3.7 thunderbird-bin 161m 33m 19m 3.3 evolution 96352 23m 17m 2.3 kmail 14548 6092 3180 0.6 mutt
Mutt uses only a fraction of the memory used by most popular e-mail clients. So, if you are using older hardware, Mutt may speed up your computer by freeing some memory. Either way, Mutt will not hog your system's resources.
Another advantage of Mutt is the text-based display. For one, the interface is highly customizable. All fields and colors can be changed to meet your demands. Color new e-mail messages green and deleted messages red. Produce pretty, threaded message views. Anything is possible.
Mutt has it all and through a shell, no less. No longer will you need to open up IMAP access to your private server. Instead, ssh into the server and run Mutt.
Before I go into Mutt's other features, let's configure Mutt, so you can take a test drive. In this article, I focus on how to configure Mutt to work with an IMAP server. For my examples, I use Gmail's IMAP service. Because Gmail is a public, freely available service, everyone should be able to follow along. If you have another IMAP server you want to use, change the settings from my examples to match your IMAP server's configuration. If you are using Gmail, make sure you enable IMAP access to your account in Gmail's Settings→Forwarding and POP/IMAP.
First, install Mutt. I recommend using Mutt 1.5.17 or newer. Features I discuss here, such as IMAP header caching, are not available in older Mutt releases. Chances are, your distribution has the latest and greatest. So, use yum, apt-get or compile the source code from www.mutt.org. If your custom binaries ever produce warnings about unknown features, check that you have all necessary options enabled in the compile's configure step.
Before running Mutt the first time, let's configure your IMAP connection. Create and edit a ~/.muttrc file, and add the following configuration options (make sure to fill in your account specifics):
set from="YOUR NAME <USER@gmail.com>" set imap_user=USER@gmail.com set imap_pass=PASS
This sets your From line and IMAP user login. If you are not comfortable with your password being in plain text on the filesystem, do not set imap_pass in your ~/.muttrc. If imap_pass is not set, you will be prompted for a password when you execute Mutt.
Next, set your folder, the default location of your mailboxes. You also might want to set the spoolfile to your Gmail Inbox, so that Mutt opens it automatically:
set folder=imaps://imap.gmail.com set spoolfile=imaps://imap.gmail.com/INBOX
Then, configure Mutt to save sent mail, or your record, into a Gmail folder named Sent. You also might want to configure a Draft, or postponed, folder:
set record=imaps://imap.gmail.com/Sent set postponed=imaps://imap.gmail.com/Drafts
Make sure to enable header caching, or Mutt will have to download all of your Inbox's headers upon each execution:
Finally, you need to configure smtp.gmail.com as your SMTP server. By default, Mutt delivers e-mail using /usr/sbin/sendmail -oem -oi. In your case, use Gmail's SMTP server so that the e-mail envelope looks legitimate. Otherwise, your message might be flagged as spam for not originating from gmail.com:
Again, leave out :PASS to increase security and enable a password prompt for each message sent.
Although these are the basics, the .muttrc file has the potential for a slew of options. Listing 1 is my entire .muttrc with some additional tweaks. Many of the options are just that, optional. The muttrc(5) man page explains them all, so be sure to give it a look.
- Free Today: September Issue of Linux Journal (Retail value: $5.99)
- The Tiny Internet Project, Part I
- Bitcoin on Amazon! Sort of...
- Machine Learning with Python
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- Android Browser Security--What You Haven't Been Told
- Epiq Solutions' Sidekiq M.2
- Securing the Programmer
- Nativ Disc
Pick up any e-commerce web or mobile app today, and you’ll be holding a mashup of interconnected applications and services from a variety of different providers. For instance, when you connect to Amazon’s e-commerce app, cookies, tags and pixels that are monitored by solutions like Exact Target, BazaarVoice, Bing, Shopzilla, Liveramp and Google Tag Manager track every action you take. You’re presented with special offers and coupons based on your viewing and buying patterns. If you find something you want for your birthday, a third party manages your wish list, which you can share through multiple social- media outlets or email to a friend. When you select something to buy, you find yourself presented with similar items as kind suggestions. And when you finally check out, you’re offered the ability to pay with promo codes, gifts cards, PayPal or a variety of credit cards.Get the Guide