February 10, 2009

OfflineIMAP IDLE support

Filed under: Technical — Tags: , , — delx @ 4:36 pm

I’ve implemented IDLE support into OfflineIMAP. For the last day or two I’ve been using this and I’m loving the instant email notifications. I emailed the original author and plan to work with him to get the code included into an official OfflineIMAP release.

There’s a Git repository with the patch included here:
http://delx.net.au/git/offlineimap

I followed the plan John Goerzen suggested in offlineimap ticket 18. Here’s an overview of the changes.

  • Use imaplib2 as it implements the IDLE command and a few other nice things. This is written by Piers Lauder, the author Python’s standard imaplib.
  • Some small changes to the OfflineIMAP code were needed for it to work with imaplib2.
  • Added a config parameter ‘idlefolders’ to specify a list of mailboxes to monitor. This parameter forces holdconnectionopen, keepalive and maxconnections to be sane values.
  • Hijack the keepalive thread. Use the available connections for IDLE, one on each of the given mailboxes. If there are leftover connections we send NOOP as before.
  • Added documentation to the sample offlineimap.conf

4 Comments »

  1. Just updated to the new offlineimap supporting IMAP IDLE. I love it. Thanks for implementing it!

    Comment by Armim — July 13, 2009 @ 9:34 pm

  2. This is fantastic. Thanks!

    Christian

    Comment by Christian G. Warden — July 21, 2009 @ 4:12 am

  3. Any news on upstream integration ?

    Comment by Adrien Bustany — April 13, 2010 @ 4:21 am

  4. @Adrien: It was actually dropped from upstream, due to the subtle API changes that were introduced with the new imap library that was used.

    Comment by Greg Darke — April 13, 2010 @ 6:30 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment