Mutt on Mac OS X

[04.03.2013]

Prerequisites

  1. Xcode from Apple with commandline utilities installed
  2. Source from http://www.mutt.org/download.html

Building

I usually pick a directory to build everything in, like:

mkdir src && cd src

This way, all of my code stays in the same place.

Untar/gz mutt:

tar -xvf ~/Downloads/mutt-1.5.21.tar.gz

Some people like the side pane patch, but I didn't, so I'm not including it here. If you want it, google for how to add it.

Run the configure script with the --help option:

./configure --help

I don't want to install this for the whole system, I only want it to be available for my user (plus, then, I don't have to rely on anything being installed as root), so I want the --prefix=/Users/<username>.

Additionally, I want support for:

+ imap - requires ssl for imaps
+ smtp
+ sasl

$ ./configure --prefix=/Users/bmcduffi --enable-imap --with-ssl --enable-smtp \
--with-sasl --enable-debug

This seems to have worked, but I get this error:

Error in /Users/bmcduffi/.muttrc, line 17: header_cache: unknown variable

Hmm. Ok, some googling, and I see that I needed --enable-hcache.

$ ./configure --prefix=/Users/bmcduffi --enable-imap --with-ssl --enable-smtp \
--with-sasl --enable-debug --enable-hcache

Now this error:

checking for BerkeleyDB > 4.0... no
configure: error: You need Tokyo Cabinet, QDBM, GDBM or Berkeley DB4 for hcache

As much as I dislike Oracle, they have apparently acquired every "database" known to human people. Here's a direct link to getting the source for berkeleydb:

http://download.oracle.com/berkeley-db/db-5.3.21.tar.gz
tar -xvf ~/Downloads/db-5.3.21.tar.gz
cd db-5.3.21/

We need to patch the code to make it compile on Xcode 4.6

curl -O https://raw.github.com/narkoleptik/os-x-berkeleydb-patch/master/atomic.patch
patch src/dbinc/atomic.h < atomic.patch

Back to building BerkeleyDB

cd build_unix
../dist/configure --prefix=/Users/bmcduffi
make && make install

Back to our mutt src dir:

cd ~/src/mutt-1.5.21
./configure --prefix=/Users/bmcduffi --includedir=/Users/bmcduffi/include --enable-imap --with-ssl \
--enable-smtp --with-sasl --enable-debug --enable-hcache --with-bdb
make && make install

Wow, that was quite a bit of work, but now I have a self-contained mutt installation in my homedir!

xcode mutt mac os x