Google Apps mail ( & Gmail) on the commandline with Mutt

After getting sick of the bloat and overhead of Thunderbird, Outlook, OSX’s Mail and the other usual suspects, after a weekend of playing around with various clients I am now using Mutt on my primary lappy as my primary email.

A skeleton .muttrc config file for Google Apps Mail / Gmail using IMAP is as follows. This is without any keyboard shortcut bindings or colours which are highly recommended and the cache dirs are not created by default and will have to be created manually. Additional to the .muttrc is a mailcap config which determines which 3rd party programs are used to view extended data such as HTML and images. Replace username, domainname and password with your details.

# A basic .muttrc for use with Google Apps mail and Gmail
set imap_user = "[email protected]"
set imap_pass = "password"
set smtp_url = "smtp://[email protected]"
set smtp_pass = "password"
set from = "[email protected]"
set realname = "Your Name"

# Boilerplate config
set folder = "imaps://"
set spoolfile = "+INBOX"
set imap_check_subscribed
set hostname =
set editor = "vim"
set mail_check = 30 #seconds between mail checks
set timeout = 300
set imap_keepalive = 300
set postponed = "+[Gmail]/Drafts"
set record = "+[Gmail]/Sent Mail"
set header_cache=~/.mutt/cache/headers
set message_cachedir=~/.mutt/cache/bodies
set certificate_file=~/.mutt/certificates
set mailcap_path    = ~/.mutt/mailcap
set move = no
set include
set sort = 'threads'
set auto_tag = yes
hdr_order Date From To Cc
auto_view text/html
bind editor <Tab> complete-query
bind editor ^T complete
bind editor <space> noop

A basic mailcap (as referenced above) to use lynx as HTML viewer is:

text/html; lynx -display_charset=utf-8 -dump %s; nametemplate=%s.html; copiousoutput

Codemonkey of Node.js, Django, PHP and all things HTML5 Solving tech challenges, one bit at a time.

Posted in email, linux Tagged with: , , , ,
One comment on “Google Apps mail ( & Gmail) on the commandline with Mutt
  1. Nice, pretty basic but a good start. Just what I need for the basic settings!

Leave a Reply

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