Five Pounds of Flax

Every culture has a burrito.

IDLE support for IMAP accounts in Apple's

Monday, September 18, 2006posted by Michael Rothwell @ 11:18 PM

Apple's mail client ( supports IMAP accounts, but does not support the IDLE extension (RFC 2177). IDLE is good, because it lets the server notify clients when new mail arrives, meaning that clients don't have to poll. Or at least, will get new mail more often than $POLL_INTERVAL.

I'm writing a plugin (a "mailbundle") for that implements support for IDLE. It opens a connection for each IMAP account, selects the INBOX, enters IDLE mode, and waits for messages. When it gets a message from the server indicating that new mail has arrived, it causes to check for new mail in that account.

The first working version is running in debug mode on my Mac right now, monitoring mail over an SSL connection to my IMAP server. It won't reconnect if disconnected, currently, and ignores network state. Those are to-do items.

I'll release it on VersionTracker when it's ready for public consumption.

The first release version can be downloaded here (link disabled). It's a Universal Binary, reconnects when disconnected, and is working well on my MBP and my wife's Powerbook. You must be running Tiger (10.4.x) to use this.

Not all IMAP servers support IDLE. As a future update to the IDLE plugin, I'll have it report back about your server's capabilities. Until then, here's a page describing how to tell if your server supports IDLE. Long story short: iPlanet and DotMac do not! Exchange does, as does cyrus and dovecot.

Version 1.01 is available here: (link disabled). It is a minor update to fix problems some folks were having with particular IMAP servers; the plugin was failing to recognize that the server was in IDLE mode due to the server giving a response unexpected by my code. If version 1.0 is working for you, there's no reason to update to 1.01.

I've gotten a number of great bug and usage reports. Thanks, everyone! I'm working on the following issues:
  1. Observing the "enabled/disabled" status of individual mail accounts
  2. Observing the "online/offline" status of Mail.
I'll have an update out in the next day or two, probably!

** UPDATE 2006-09-26
Version 1.02 (link disabled) is available. It respects the "enabled" setting for individual accounts, and handles accounts being taken "offline". It also checks for your server's capability to support the IDLE extension and reports yea or nay back in the console log (see /Applications/Utilities/ This version is working for my very small group of testers (me, my wife). Give it a shot!

** UPDATE 2006-09-30
Version 1.03 is available here.