abhi's logbook

Adventures in coding and coding for adventures.


I am slowly moving to text based tools as opposed to using the web. I
will be making the configurations available for all the different
tools I decide to move to.

I decided that mutt was worth a try. So I put together a configuration
that works with Gmail by scouring the internet. First follow the
directions listed on Lifehacker’s article but use this for the
configuration. Change my email address to your’s at the appropriate

Also, I want mutt to ask me for my password everytime I use it. This

When ever you delete from mutt what it does is removes the “label” so
stuff is never deleted but moved to “All mail”. So in this
configration there is no way to delete mail. If you want that please
look at the Lifehacker configuration.

# Change the following six lines to match your Gmail account details
set imap_user = "[email protected]"
# set imap_pass = "PASSWORD"

set smtp_url = "smtp://[email protected]@smtp.gmail.com:587/"
# set smtp_pass = "PASSWORD"

set realname = "Abhi Yerra"
set from = "[email protected]"

# Change the following line to a different editor you prefer.
set editor = "emacsclient"

# Basic config, you can leave this as is
set folder = "imaps://imap.gmail.com:993"
set spoolfile = "+INBOX"
set imap_check_subscribed
set hostname = gmail.com
set mail_check = 120
set timeout = 300
set imap_keepalive = 300
set postponed = "+[Gmail]/Drafts"
set record = "Sent"
set header_cache=~/.mutt/cache/headers
set message_cachedir=~/.mutt/cache/bodies
set certificate_file=~/.mutt/certificates
set move = no
set include
set sort = 'threads'
set sort_aux = 'reverse-last-date-received'
set auto_tag = yes
ignore "Authentication-Results:"
ignore "DomainKey-Signature:"
ignore "DKIM-Signature:"
hdr_order Date From To Cc
alternative_order text/plain text/html *
auto_view text/html
bind editor <Tab> complete-query
bind editor ^T complete

# Gmail-style keyboard shortcuts
macro index,pager gi "<change-folder>=INBOX<enter>" "Go to inbox"
macro index,pager ga "<change-folder>=[Gmail]/All Mail<enter>" "Go to all mail"
macro index,pager gs "<change-folder>=[Gmail]/Starred<enter>" "Go to starred messages"
macro index,pager tp "<change-folder>=[Gmail]/Important<enter>" "Go to priority inbox"
macro index,pager gd "<change-folder>=[Gmail]/Drafts<enter>" "Go to drafts"

# Spam stuff.
macro index,pager S "<save-message>=[Gmail]/Spam<enter>" "mark message as spam"
macro index,pager H "<save-message>=INBOX<enter>" "mark message as ham (not spam)"