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