next up previous contents
Next: Sending your mail: Up: Offline IMAP Previous: Offline IMAP   Contents

Getting your mail:

From a user's point of view, Mac OSX's Mail program got it right: your IMAP account is cached locally, and updates changes whenever you connect. It does away with ``I'm not connected to the 'Net so I can't access my old mail'' and basically allows the user not to care what kind of mail account he's using. Mutt users can now do the same. Offlineimap is a package of Python scripts that replicates your entire IMAP account locally, sub-folders and all. The first time you sync, it can take some time, but afterwards the program runs quickly, and you can even set it to run in the background.

First, download and install offlineimap. It requires a somewhat modern version of Python. Next, give offlineimap a place to store its local cache (this will turn into a gigabyte- or greater-sized directory, so choose carefully): mkdir .mailcache. The man page will walk you through the next steps, but essentially, you need only to declare the parameters for the local and IMAP accounts, and then execute the program periodically. Here's a sample offlineimap configuration:

[general]
accounts = personalmail

[Account personalmail]
localrepository = local
remoterepository = remote

[Repository local]
type = Maildir
localfolders = ~/.mailcache
sep = /
[Repository remote]
type = IMAP
remotehost = MYISP.WHATEVER.NET
remoteuser = MYLOGINNAME
ssl = yes
remotepass = MYPASSWORD

Finally, since you will now be accessing not your IMAP account but the local, replicated repository, your .muttrc should point to it as follows:

set folder=$HOME/.mailcache/INBOX/
set spoolfile=$HOME/.mailcache/INBOX
set record="=Sent"   # or whatever your sent mailbox is called


next up previous contents
Next: Sending your mail: Up: Offline IMAP Previous: Offline IMAP   Contents
Randall Wood 2009-12-02