OfflineIMAP
OfflineImap operates on a REMOTE and a LOCAL repository and synchronizes emails between them, so that you can read the same mailbox from multiple computers. The REMOTE repository is some IMAP server, while LOCAL can be either a local Maildir or another IMAP server.
I linked to offlineimap last year, but since then it’s improved a great deal—it’s faster, thanks in part to a new SQLite backend, and much more stable—so I thought I’d give it another plug.
Here’s the ~/.offlineimaprc I use to sync with/backup my Gmail account:
[general] metadata = ~/.local/share/offlineimap accounts = GMail maxsyncaccounts = 1 ignore-readonly = no [Account GMail] localrepository = Local remoterepository = Remote status_backend = sqlite [Repository Local] type = Maildir localfolders = ~/mail [Repository Remote] type = Gmail remotehost = imap.gmail.com remoteuser = your.email@gmail.com remotepass = yourpassword ssl = yes maxconnections = 2 realdelete = no folderfilter = lambda foldername: foldername not in ['[Google Mail]/Spam', '[Google Mail]/Bin']
NB: Gmail’s folder names differ in different countries, so you might need to edit the last line, and perhaps add some more folders to exclude (eg. ‘All Mail’).