My mutt setup
mutt is a small but very powerful text-based mail client for Unix operating systems. It is fast and powerful, but not very easy to install and set up on Mac OS X. This post will mainly function as a note to myself about what I did to get mutt, offlineimap and msmtp to work with Google Apps on OS X.
Installation
There are several components involved in my mutt setup. This section will describe in detail how to install each one of them.
Installing Homebrew
The easiest way to install mutt is to use Homebrew - The missing package manager for OS X. At the time of writing, the official documentation of Homebrew says this is the way to install it:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Please consult the current documentation of Homebrew before installing. Also note that Homebrew requires ruby.
Installing offlineimap
Once you have Homebrew installed, it's time to move on to installing offlineimap. offlineimap is a software that lets you download your mailbox as a local Maildir folder. It basically synchronizes your mailbox to your local harddrive. This will make your email experience very fast and also lets you browse your email when being offline.
With Homebrew, installing offlineimap is very easy:
brew install offlineimap
Installing msmtp
msmtp is an SMTP client that allows you to send email using your email provider's SMTP server. When you send an email, mutt will trigger msmtp to deliver the mail to Gmail's SMTP server.
Again, using Homebrew, the installation is super easy:
brew install msmtp
Installing mutt
Now to the more difficult part. I've struggled to install mutt on Mac OS X using Homebrew because of some errors saying the ncurses library is missing. Some recommend building mutt against the S-Lang library instead, but this guide will explain how to build against ncurses.
Generally, you should be able to install mutt using Homebrew, like this:
brew install mutt
In my setup I've also included a nice addon: The sidebar patch. This gives you a folder list on the left side of the screen, like this:
To be able to install The sidebar patch, you need to edit the brew formula for mutt:
brew edit mutt
This will open an editor with the mutt formula, and you'll need to add a few lines to it. To begin with, you need to add an option called with-sidebar-patch
, like this:
option "with-sidebar-patch", "Apply sidebar patch" # <- Add this line
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"
Then you'll need to add the actual patch information to the file. Add these lines close to the other lines looking similar:
patch do
url "https://raw.github.com/nedos/mutt-sidebar-patch/master/mutt-sidebar.patch"
end if build.with? "sidebar-patch"
Now, try installing mutt using the following command:
brew install mutt --with-sidebar-patch --with-pgp-verbose-mime-patch
Note: The --with-pgp-verbose-mime-patch
is only necessary if you plan on using PGP and want to be able to change the filename of the signature attachment.
If you get an error complaining about the missing ncurses library, you can try this before running the above command:
brew install ncurses
brew doctor
brew link ncurses
If the last command fails, try this instead:
brew link ncurses --force
Now, you can again try to install mutt using Homebrew:
brew install mutt --with-sidebar-patch --with-pgp-verbose-mime-patch
Hopefully, you've now managed to install all the necessary applications needed to continue with the configuration.
Configuration
Now what?
I’m genuinely thrilled that you’ve made it this far — thank you for reading!
If you’re up for more, here are a few things you can do:
- Reply to this post by email – I’d love to hear from you.
- Subscribe via RSS or email to stay in the loop.
- Reach out on Mastodon – I’m always happy to chat.