Summary
- Mutt is a text-based email client known for speed and customization, with support for features like PGP and message threading.
- Command-line email clients like Mutt offer fast inbox navigation, customization, offline reading capabilities via tools like isync, and seamless integration with notmuch for easy search.
- Mutt is ideal for terminal-based users who primarily deal with plain text emails.
Not a fan of webapps for email but find traditional mail clients too bulky and slow? Try a more minimalist approach, sending and receiving your email from the command line with Mutt.
An Introduction to Mutt
Mutt is a text-based email client with a colorful slogan: “All mail clients suck. This one just sucks less.”
Though it is far from the first text-based email client, it is fairly long-running, with the project having kicked off in 1995. The project was written from scratch, though the interface was originally based on the ELM email client, first released in 1986, and updated with features from other clients like PINE.
Despite its age, Mutt has kept up with the times, at least in terms of supporting technology like PGP and support for message threading. That said, development has slowed in terms of features.
If Mutt development is too slow for you, NeoMutt rolls in many patches that haven’t made it to Mutt yet, like a sidebar for navigating between folders, for example. NeoMutt can even read your Mutt configuration file, though this won’t work the other way around if you use NeoMutt-specific features.
The Advantages of Command Line Email
One of the biggest advantages of using a command-line email client like Mutt is the speed. For whatever reason, most traditional email clients feel slow on even the fastest computer. Thunderbird has improved massively recently, but even then, it doesn’t hold a candle to the sheer speed of Mutt at moving through a packed inbox.
Mutt is, like many command line tools, eminently customizable. For example, if you’re a Neovim fan, it’s easy to configure the app to use that editor to handle any text input in Mutt.
Similarly, while a basic setup can get you connected to your mail server, you can also use other tools like isync
and mstmp
to read and reply to your email offline, then sync it all later. If you frequently catch up on email on a train or anywhere else with spotty Wi-Fi, this can be a great feature.
You can integrate other tools as well. If you’re storing your email offline, you can easily search it with a tool like notmuch
, which you can integrate directly into Mutt.
Getting Started With Mutt
It’s not likely you’ll already have Mutt installed, but it’s available in the software repositories of most popular Linux distributions. NeoMutt is also commonly available, but not as reliably as Mutt.
To install Mutt on Debian, Ubuntu, or similar systems, run the following:
sudo apt install mutt
On Fedora and similar distributions, run:
sudo dnf install mutt
On Arch and Arch-based distributions, run the following:
sudo pacman -S mutt
Now you’ll need to create a few directories. Run the following commands, one line at a time:
mkdir -p ~/.mutt/cache/headers
mkdir ~/.mutt/cache/bodies
touch ~/.mutt/certificates
Now, you’ll need to set up your configuration file. This is where things can get complicated, as it varies based on your mail provider, how many accounts you want to set up, and a variety of other factors.
The basic configuration below comes from the MUO guide to Mutt with Gmail, and is enough to get you up and running if you use Gmail. Create the file ~/.mutt/muttrc
in your favorite text editor and add the following:
set from = "username@gmail.com"
set realname = "First Last"
set imap_user = "username@gmail.com"
set imap_pass = ""
set smtp_url = "smtps://username@smtp.gmail.com"
set smtp_pass = ""
set folder = "imaps://imap.gmail.com/"
set spoolfile = "+INBOX"
set postponed = "+[Gmail]/Drafts"
set record = "+[Gmail]/Sent Mail"
set trash = "+[Gmail]/Trash"
Save the file, and run the command:
mutt
You may not see anything at first, but the app should load and start displaying your email. Of course, if you use another email provider, you’ll need to look up your specific server information, and you’ll need to use your correct login info.
If you’re going to use Mutt frequently, it’s a good idea to use a utility like pass
to securely store your password and call that from your Mutt config, but that’s beyond the scope of this article.
Mutt displays the keys for its most commands right on the screen, so you should be able to find your way around. That said, if you try to open an email that features emails or images, you may be puzzled about what you see. Mutt doesn’t handle graphics, but we can handle that. At least, somewhat.
What About Images and Graphics?
While Mutt can’t directly display HTML email, it can do two things: filter them through a text-based web browser or open them in a traditional web browser like Firefox. My personal solution is to opt for both.
First, open ~/.mutt/muttrc
again and add the following line:
auto_view text/html
Now, install the lynx web browser with one of the following commands.
To install on Debian, Ubuntu and similar distros:
sudo apt install lynx
For Fedora, etc.:
sudo dnf install lynx
On Arch-based distributions, run:
sudo pacman -S lynx
Now, open ~/.mutt/mailcap
in the text editor of your choice and add the following lines:
text/html; firefox %s;
text/html; lynx -assume_charset=%{charset} -display_charset=utf-8 -dump %s; nametemplate=%s.html; copiousoutput
If you want to use a browser other than firefox, replace firefox
in the first line above.
Save the file and exit. Now, when you open an HTML email in mutt, it will attempt to display it. If you prefer, you can hit the v
key then m
to open the message in a web browser.
Replying to HTML messages is more of a mess. Depending on the editor you’re using to write your replies, the HTML message may not be formatted correctly when you reply. If this is important, you may want to run some tests before you use Mutt for essential email communications.
Who Is Mutt For?
If you’ve read through this article and you’re still interested, it seems like Mutt is for you. The text-first design imposes certain limitations, but if you mainly deal with plain text emails and find the workarounds for viewing emails with graphics acceptable, the speed of Mutt’s workflow is hard to ignore.
Mutt is also a great choice if you already spend most of your time in the terminal already. If you do all of your writing in Vim, being able to use the same editor for composing emails makes a lot of sense, as all the editing shortcuts you already know from Vim apply.
That said, if you need to send HTML or email with embedded images, Mutt isn’t a viable choice. It’s also not great if you frequently need to read emails with heavy HTML formatting or images, though you can deal with this by viewing messages in a web browser as mentioned above.
Finally, it’s worth instead considering the question, “what is Mutt for?” As an example, I use Mutt more for processing email—deleting, archiving, and filing email—than I do for reading or sending email. If you find it perfect for one task but not others, feel free to keep using it as a utility, rather than your only mail app.