Mutt – A Command Line Email Client to Send Mails from Terminal


Table of Contents

Mutt – A Command Line Email Client to Send Mails from Terminal

apt-get install mutt

Configuration files

Configuration files of Mutt Email client.

Main Configuration file: To make changes globally for all users For mutt, you can make changes in its mail configuration file “/etc/Muttrc“. User Configuration file of Mutt : If you want to set some specific configuration for a particular user for Mutt, you can configure those settings in ~/.muttrc or ~/.mutt/muttrc files.

0.1 Gmail config

n gmail, go click the gear icon, go to Settings, go to the tab Forwarding POP/IMAP, and click the Configuration instructions link in IMAP Access row.

Then click I want to enable IMAP. At the bottom of the page, under the paragraph about configuring your mail client, select Other. Note the mail server information and use that information for further settings as shown in the next section.

Before proceeding further visit and checkTurn on radio button.


Edit the ~/.muttrc and add the following:

set realname = "<first and last name>"
set from = "<gmail username>"
set use_from = yes
set envelope_from = yes

set smtp_url = "smtps://<gmail username>"
set smtp_pass = "<app password>"
set imap_user = "<gmail username>"
set imap_pass = "<app password>"
set folder = "imaps://"
set spoolfile = "+INBOX"
set ssl_force_tls = yes

# G to get mail
bind index G imap-fetch-mail
set editor = "vim"
set charset = "utf-8"
set record = ''

Most of the config is pretty trivial but the <app password> is where I got stuck. Most online tutorials instructs to simply put your Gmail password but that won’t work. Instead head here:

Once you login, you can generate a new app specific password for this use case. This way, you’ll also won’t have to worry about saving your main password in a plaintext file.

After generating, simply plop it into the ~/.muttrc file and run mutt and you will see it download all emails from your inbox. Most of the key are indicated at the top of the screen so it should be relatively intuitive.

Visit for more detailed guides on controls and such.

Edit: After a short while you’ll realize that Mutt is completely pointless because most modern emails are made with HTML templates which means you’ll just see a bunch of code. Maybe there’s a plugin solution?

1 Extra

Author: Sebastian Emilio Narvaez

Created: 2019-10-23 Wed 07:41

Emacs 25.2.2 (Org mode 8.2.10)