Alternatively, have a discrimination between "incoming" mailboxes and mailboxes which are strictly archive. Don't even consider the archive mailboxes, which for most users greatly overwhelm the number of incoming mailboxes. If you are a reasonable number of incoming mailboxes, then just have all of these mailboxes SELECTed in separate IMAP sessions; this is the most efficient, best real-time, and least-costly way to monitor a set of mailboxes.
That becomes tricky in multiple-client situations, though, doesn't it? If the user accesses his mail from several locations (and particularly if he leaves the client open in more than one), messages may be added to an "archive" folder manually in one client that the other client would need to find out about.
Put another way; 5 IMAP sessions monitoring 5 mailboxes is less costly (often *MUCH* less costly) than repeatedly probing those 5 mailboxes in one IMAP session. Sessions are cheap, especially if you use the IDLE command. Polls are not cheap, especially with mail stores that oblige the server has to parse the enter mailbox to satisfy a STATUS.
Might this method run into problems with providers that limit the number of simultaneous connections from a given IP?
Thanks again, --Dave
------------------------------------------------------------------------ --
David A. Feldman
User Interface Designer
http://InterfaceThis.com
