Configuring Mutt for Gmail server

Mutt is a very old and reliable command line mail user agent used for multiple Operating Systems including Linux.

It have lots of amazing features, very much user friendly and supports POP3, IMAP, SMTP etc.

This post is to configure gmail in mutt, since gmail is a widely used EMail system. Any Linux developer who wish to contribute to kernel should send the patches from a non-HTML based email system (bye bye web mail..). So if we have mutt configured in terminal, it is very easy to attach sources and send mail.

Configuring Gmail

1. Go to gmail web -> Settings ->Forwarding and POP/IMAP
a) Enable POP Download
b) Enable IMAP access.

2. Install mutt in your machine.

Choose your way here, get deb package or apt get (for ubuntu/debain), I used

‘yum install mutt’

Since I have a fedora box and I got mutt installed without any hassles.

3. Create file .muttrc in your home folder (~/.muttrc)

set imap_user = "your_gmail_user_name"
set imap_pass = 'yourpasswordhere'

set smtp_url = "smtp://”
set smtp_pass = 'yourpasswordhere'
set from = ""
set realname = "Your Name"

set folder = "imaps://"
set spoolfile = "+INBOX"
mailboxes = "+INBOX"

set postponed="+[Gmail]/Drafts"

set header_cache=~/.mutt/cache/headers
set message_cachedir=~/.mutt/cache/bodies
set certificate_file=~/.mutt/certificates

set move = no

and create directory ~/.mutt

password is the tricky stuff here. It you have provided a null string in password field mutt will prompt for password. But if you have special characters in password its better to put your password in muttrc file in single quotes.

The last thing you have to do is, Gmail will block you if you sign-in from  from insecure device or app. So first you have to enable access for less secure apps in after logging in to your google account.

Screenshot from 2014-11-23 15:44:38

Once ‘Access for less secure apps‘ is Enabled, you can start ‘mutt’ from your terminal and you can see all your mails from gmail do send / receive operations


Have fun!!


  • Write more, thats all I have to say. Literally,
    it seems as though you relied on the video to make your point.

    You clearly know what youre talking about, why throw
    away your intelligence on just posting videos to your
    blog when you could be giving us something informative to read?

  • Someone necessarily help to make significantly posts I’d state.

    That is the very first time I frequented your website page and so far?

    I amazed with the analysis you made to create this actual submit amazing.
    Great job!

Leave a Reply

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

eight − 2 =