Search code examples
emailimap

An efficient way to check the inboxes of a large number of email accounts constantly


I wonder how those email management apps (such as Mailbox) keep checking the inboxes of a large number of email accounts constantly. Do they keep an IMAP connection with the server for each account by sending the IDLE command? It seems to me that this will need a lot of resources by keeping a large number of connections. Is there any more efficient way?


Solution

  • See my answer at https://stackoverflow.com/questions/16065164/automatic-imap-connection-kill-script/16066325#16066325 -- now removed, but available through the wayback machine.

    It is, unfortunately, a pretty wide-spread misconception that "a lot of connections" implies "using a lot of resources", but unless both you and your target servers support the NOTIFY extension, there isn't anything better than IDLE that you could use.