Find file History
Latest commit 553545e Nov 20, 2016 @zanshin Updating and dusting off mutt configuration
Tweaking colors used
Updated offlineimap UI


Here be Dragons


The mutt directory in my dotfiles contains the configuration of my mutt mail setup. This is heavily influenced by The Homely Mutt. You should go read that from top to bottom several times before attempting to use or mimic my mutt setup.

Unlike Git or Vim or tmux where lack of understanding is relatively harmless, screwing up mutt or offlineimap could result in permanently lost email.



This configuration relies upon a number of tools. They are presented in the order The Homely Mutt introduces them. (You did read that, right?)

  • Offlineimap

    git clone git://
    cd offlineimap
    git checkout 679c491c56c981961e18aa43b31955900491d7a3
    python install

Note: sudo may be required for the install step.

  • Mutt

    $ brew install mutt --sidebar-patch

At present the brew formula for mutt does not include the sidebar patch. Follow these steps to edit the formula:

$ brew edit mutt

Scroll down to a section of commands that all start with "option", sort of like:

option "with-debug", "Build with debug option enabled"
option "with-trash-patch", "Apply trash folder patch"
option "with-s-lang", "Build against slang instead of ncurses"
option "with-ignore-thread-patch", "Apply ignore-thread patch"
option "with-pgp-verbose-mime-patch", "Apply PGP verbose mime patch"
option "with-confirm-attachment-patch", "Apply confirm attachment patch"

Add this line to the bottom of the options:

option "with-sidebar-patch", "Apply sidebar patch"

Scroll down further to the section with all the patches, e.g.

patch do
  url ""
  sha1 "6c8ce66021d89a063e67975a3730215c20cf2859"
end if build.with? "trash-patch"

And add this block:

patch do
  url ""
  sha1 "1e151d4ff3ce83d635cf794acf0c781e1b748ff1"
end if build.with? "sidebar-patch"

Exit the editor and run the brew install mutt --with-sidebbar-patch command.

  • urlview

    $ brew install urlview

  • msmtp

    $ brew install msmtp

  • contacts (requires full Xcode install)

    $ brew install contacts

  • notmuch

    $ brew install notmuch


With the dependencies installled, symlinks can be created to the contents of the ~/.dotfiles/mutt directory.

$ ln -s ~/.dotfiles/mutt ~/.mutt
$ ln -s ~/.dotfiles/mutt/offlineimaprc ~/.offlineimaprc
$ ln -s ~/.dotfile/mutt/msmtprc ~/.msmtprc
$ ln -s ~/.dotfiles/mutt/notmuch-config ~/.notmuch-config
$ ln -s ~/.dotfiles/mutt/urlview ~/.urlview

To download mail:

$ mkdir ~/.mail
$ offlineimap

Note, this will likely take a very long time.

Add new mail account

Update offlineimaprc

  • Add account name to accounts
  • Create [Account ...] section for new account
  • Create [Repository ...-Local] section for new account
  • Create [Repository ...-Remote] section for new account

Add Keychain entries

Use Keychain Access app to create new http://imap.server.tld and smtp://smtp.server.tld password entries for the new account.

Synchronize email

Run offlineimap to download email.

$ offlineimap

The first time the new keychain entries are accesed you will have to repsond to a GUI dialog. Click Always allow. Resolve any errors before proceeding, this way the download can happen while the rest of the steps below are completed.

Update Mutt configuration

Edit ~/.muttrc. Update Account Settings section. Add new account's mailboxes to list that appears in sidebar. Reorder sidebar if desired.

Add folder-hook for new account.

Create accounts entry

The folder-hook in .muttrc requires a new file in the ~/.mutt/accounts directory. Copy an existing entry, rename it, and edit the contents for the new account.

Create msmtprc entry

In order to send mail create a new account entry in ~/.msmtprc.

Test new account

Once offlineimap has completed the initial mail download, you should see the account in mutt.