Gmail IMAP and Mutt on OSX

Having had a few false starts getting Mutt working with the new Gmail IMAP I thought I’d share my setup incase it is of any help.

Firstly to use Mutt in OSX you’ll need to install MacPorts if you don’t have it. Once that’s setup you can proceed to install Mutt:

$ sudo port install mutt-devel +headercache +imap +ssl

mutt-devel gives the latest version, +imap and +ssl are needed to use the IMAP service and +headercache stops Mutt needing to download the headers from the server every time it is run.

Having installed Mutt you’ll need to configure for using Gmail IMAP, this is done by adding the following to your ~/.muttrc

set imap_user = 'yourmail@gmail.com'
set imap_pass = 'yourpass'
set spoolfile = imaps://imap.gmail.com:993/INBOX
set folder = imaps://imap.gmail.com:993
set record="imaps://imap.gmail.com/[Google Mail]/Sent Mail"
set postponed="imaps://imap.gmail.com/[Google Mail]/Drafts"
set header_cache="~/.mutt/cache/headers"
set message_cachedir="~/.mutt/cache/bodies"
set certificate_file=~/.mutt/certificates 

Of course you’ll need to change the values in the top two lines. I’ve also used [Google Mail] here as I’m in the UK, but in most other places you’ll need to replace that with [Gmail]. If you’re not sure, don’t worry you can use either to start with and you’ll be able to see the correct value in the Mutt folder list.

You should now be able to run Mutt and see all your mail and folders.


About this entry