IDLE support for IMAP accounts in Apple's Mail.app
Apple's mail client (Mail.app) 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 Mail.app 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 Mail.app 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.
** UPDATE
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.
** UPDATE
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.
** UPDATE
Version 1.01 is available here: IMAP-IDLE-1.01.zip (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.
** UPDATE
I've gotten a number of great bug and usage reports. Thanks, everyone! I'm working on the following issues:
- Observing the "enabled/disabled" status of individual mail accounts
- Observing the "online/offline" status of Mail.
** 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/Console.app). 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.

13 Comments:
hmm... I know my mailserver supports IDLE (running courier-imap, and I use it with ChatterEmail on my Treo 650), but it seems like after adding the bundle it's still not doing anything (and yes, I quit mail and issued the two 'defaults' commands, too).
Hi,
Try version 1.01. Blogger's really slow today, otherwise the link would already be there.
This post has been removed by a blog administrator.
Let's try that again...
Kerio Mailserver supports RFC 2177 Idle. I'll give it a try.
Your plug-in works well with Kerio so far. I'll try it out for a week and let you know how it goes.
This is great, thanks for releasing it!
I'm having my incoming mail sorted on the server (.procmailrc rules). Will your plug-in be able to tell me when there's new mail in a sub-folder?
With each update, do we have to then 'reissue' the two appropriate terminal commands?
No, issuing them once should be sufficient.
I get this in the console:
2006-09-27 17:23:21.837 Mail[280] IM_NOT_AUTHENTICATED: xxxx: * BAD Protocol Error: "Command received without terminating CR LF sequence".
Ideas?
It works. BUT when internet connection is lost it often brings mail crashing...
How does one uninstall this? TIA!
Works good here, but I whenever I lose routing capability (Working in a wireless network that requires authentication), the Mail.app crashes.
Yep... crashing here when waking from sleep with Mail.app running. I imagine that's similar to what the above poster is seeing.
<< Home