This page describes my offline mail setup, which is based heavily on Joey Hess' setup, as he described it to me. (Well, that was true when I first wrote this doc, before I moved away from isync).
IMAP4 is capable of working in "disconnected" mode. This allows you to manipulate messages in your local mailbox while you are offline, and have your changes synced up with the server upon reconnect. In fact, you can keep multiple offline clients in sync in this manner.
I use the following packages (from the Debian/GNU Linux distribution) for this setup:
Aron Griffis uses a modified version of this approach, documented here.
I use courier-imap as my imaps server. Authentication occurs over ssl, so no plain text passwords are sent. Each of my clients periodically runs offlineimap (either by hand, or via a cronjob) in order to communicate changes back to the server and receive any new messages.
Recent versions of courier support an "Outbox" enhancement. When a client uploads a message to the Outbox folder on the server, courier can be configured to hand that message off to your MTA. This allows you to compose messages offline, and have them transmitted from your imap server when you reconnect.
MAILDIR=$HOME/Maildir DEFAULT=.mbox/mbox is a poor name of course, I just use it for historical reasons.
Mutt is very configurable, and it is quite easy to integrate into this setup.
#!/bin/sh echo "Saving to Outbox..." safecat /home/dannf/Mail/Outbox/tmp /home/dannf/Mail/Outbox/new
macro index $ "!/usr/bin/offlineimap -a Home\n" macro pager $ "!/usr/bin/offlineimap -a Home\n"
I like to be able to read both my personal mail and my work mail on my laptop. However, I like to keep the two separate as much as possible. Here's what I do to maintain this separation:
nametrans = lambda foldername: re.sub('^INBOX.', '', foldername)which just strips off the 'INBOX.' prefix. And in my [work] section, I have:
nametrans = lambda foldername: re.sub('^INBOX.', '', re.sub('$', '.work', foldername))which also adds the .work suffix to each folder. I could've just kept them in separate directories, but I use the following muttrc option to dynamically specify my mail folders, and was too lazy to change it:
mailboxes `find ~/Mail -type d -maxdepth 1 -mindepth 1 -printf "%f "`
# from Omnic set sendmail="/home/dannf/bin/mailout" ## use a different Outbox for work mail folder-hook ".*\.work" "set sendmail=/home/dannf/bin/mailout.work"The distinction is made based on the folder I am in when I compose/send out a message. I do similar things to keep my Trash and Sent folders separate. mailout.work copies the message into my Outbox.work folder, which will later sync to my mail server at work.
folder-hook ".*\.work" 'my_hdr From: dann frazier <email@example.com>'
macro index $ "!/usr/bin/offlineimap -a home\n" macro pager $ "!/usr/bin/offlineimap -a home\n" folder-hook ".*\.work" 'macro index $ "!/usr/bin/offlineimap -a work\n" folder-hook ".*\.work" 'macro pager $ "!/usr/bin/offlineimap -a work\n