1 [[!meta title="OfflineIMAP"]]
3 Our internet connection from home is somewhat flaky, and long-running
4 connections are often dropped. This is not usually a problem, I just
5 make liberal use of [[screen]] when using [[SSH]]. The dropped
6 connections *are* annoying when I'm reading my mail over [IMAP][] with
7 [[mutt]], my prefered mail client. Mutt caches many changes (marking
8 messages as read, deleting messages, etc.) and only pushes the changes
9 to the remote IMAP server periodically. If the connection drops
10 before Mutt pushes those changes, your changes get lost, and you have
11 to reconnect and work through the mail again.
13 It would be nice if I could work through my mail locally, and use a
14 more robust tool to deal with the networking side of things. There
15 are a number of tools to accomplish this, including the vernerable
16 [fetchmail][], but I use [OfflineIMAP][] because it allows me to store
17 my mail locally while retaining direct IMAP access if I need it
18 (e.g. using webmail from an internet cafe).
20 Install (on [Gentoo][]) with
22 # emerge -av net-mail/offlineimap
24 If you're running Python >= 2.7.2rc1 you'll need OfflineIMAP >= 6.3.3
25 to avoid problems such as `Unknown IMAP4 command: 'file'`.
27 Then create `~/.offlineimaprc` following the provided examples. To
28 sync my Drexel account with my local machine, I use something like:
34 localrepository = DrexelLocal
35 remoterepository = DrexelRemote
37 [Repository DrexelLocal]
39 localfolders = ~/mail/drexel
42 [Repository DrexelRemote]
45 remotehost = imap.mail.drexel.edu
49 Then run `offlineimap` to start the bidirectional syncronization.
50 With the configuration above, you'll need to drop OfflineIMAP into a
51 `cron` job (or just run it before you want to read your mail, and
52 again after you've made any local changes).
54 If you want to run OfflineIMAP continuously as a daemon, take a look
55 at the `autorefresh` configuration option.
57 [IMAP]: http://en.wikipedia.org/wiki/Internet_Message_Access_Protocol
58 [fetchmail]: http://www.fetchmail.info/
59 [offlineimap]: https://github.com/nicolas33/offlineimap
60 [Gentoo]: http://www.gentoo.org/