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.
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://email@example.com:587/” set smtp_pass = 'yourpasswordhere' set from = "firstname.lastname@example.org" set realname = "Your Name" set folder = "imaps://imap.gmail.com:993" 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 https://www.google.com/settings/security/lesssecureapps after logging in to your google account.
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