Mutt is a command line email app for Linux and here’s how to set it up

3 Mins read

Mutt is a command line email app for Linux; we continue our series of reviews for Linux-based command line applications. Check out MusicCube (music player) or nnn (file manager).

Like many terminal programs, it too has a learning curve, perhaps more than the average app. We’ll try to help simplify the process to set it up and explain how to use it.

Open a terminal to run the app and type mutt. The app’s running but can’t work because you haven’t setup your email account.

This is where you may get confused: How do I set up Mutt?

Create the configuration file

We need to place the configuration file “muttrc” in the location ~/.mutt/muttrc. Use the mkdir command or manually create it in your home/USERNAME folder. Edit the muttrc using any text editor; this document will contain the settings which are required to authenticate the email account.

Tip: I’ll tell you how I learned to use the program. Add one line (command) to the muttrc at a time, run the app and see what happens. It took some trial and error, but it was a rewarding experience.

If you’re using 2-factor authentication (and you certainly should), you’ll need to use an app password (for Gmail, Outlook, etc) to login.

Add the following lines to the muttrc file.

set imap_user =
set imap_pass = YOUR PASSWORD

Let’s add the URL for the account. Say, we’re going to use Gmail over IMAP and SMTP, you should add this line:

set folder = imaps://

Note: When you try to send a mail, mutt will ask you to enter the password, you can set the smtp_pass attribute to use your IMAP password to avoid manually entering it every time.

We’ll need a folder to download your mails from your inbox. Without this, Mutt cannot function. So add the following command to the config.

set spoolfile = +INBOX

You may have noticed that mutt takes a long time to start up (fetching message headers). To reduce this, you can set up the cache using the command

set header_cache = ~/.cache/mutt

Try running mutt again and it should start instantly, because the cache has been stored locally. Similarly, you can define more settings for the Sent, Drafts folders, etc.


The menu bar at the top of the window lets you navigate between various tabs. A list of keyboard shortcuts is displayed just below the menubar. The large pane in the center is the message viewer pane. You will see the mails that’re in your inbox along with the date, name of the sender and email subject. Highlight a message (use the arrow keys), and press enter to view the message.You can scroll down the message/inbox using Page Down and Page Up.

Mutt does not have an email composer built-in, so you’ll need to use a text editor. You can use advanced ones like Vim, emacs, or stick to the basic editors.

Tip: Add the command set editor=EDITOR to your muttrc. Replace the EDITOR with your favorite app, for e.g. set editor=emacs.

Press m to compose a new mail, and you’ll be prompted to select the recipient’s email address, and then the subject. The editor will open in the next step. Save the document and close it. Now, on the send screen in mutt, hit y to send the mail.

Try sending an email to yourself to test the functionality and make sure that everything is set up correctly.

Tip: Press ? to access the built-in help section at anytime.

Here are a few important shortcuts

q = Quit
d = Delete
m = Mail (Compose)
r = Reply
y = Send
i = exit (when reading/sending mails)

There are a lot of configuration files made by other users that you can use. Here’s mine which should let you receive, read, send emails.

set imap_user =
set realname = “YOUR NAME”
set from = “”
set folder = imaps://
set smtp_url = “smtps://
set ssl_force_tls = yes
set header_cache = ~/.cache/mutt
set spoolfile = +Inbox
set record = “+Sent”
set postponed = “+Drafts”
set trash = “+Trash”
set editor = “emacs”

The ArchLinux Wiki for Mutt was used as a reference source for this article.

I didn’t want to make this a basic tutorial, but seeing as the official Wiki was a bit confusing, I wrote one to help people. Maybe I’ll write a follow-up with advanced options, or review the NeoMutt client soon.

Love Tech? Join Us For Latest Updates In Tech World!

We respect your privacy! We'll never spam you!

Leave a Reply

Your email address will not be published. Required fields are marked *