The Good Life... a weblog about life, technology, and the Opera web browser

Seeking IMAP Rewrite Criticism

The IMAP backend in M2 is currently undergoing a complete rewrite to address several limitations of the current backend. This new backend will not be in 7.50, but should be in the next major release after it. Details about the rewrite were posted on the Opera newsgroups by one of the M2 developers, Frode Gill.

The issues he will address in the rewrite are in short these:

  • Make a cleaner queue and state system, so it is possible to follow the code and fix bugs...
  • Improve the response by making two incoming queues, instead of the current single one (reason: one for normal requests and one for high-priority requests, like body-fetches while backend is busy syncing folders)
  • Improve auto-detection and -correcting code by making one outgoing queue (reason: current implementation forgets commands the moment they are sent. For NO or BAD responses, M2 simply doesn't have the data needed to adjust or resend the command in different format)
  • Use two connections, if server allows it. One will stay selected on Inbox as often as possible, the other will be used to select the other folders (reason: remove selecting overhead by minimizing the frequency Inbox needs to be selected)
  • Add timeout for connections. Actual timeout will depend on number of connections, selected folder and connection mode (reason: reduce resources)
  • With timeout and/or multiple connections in place, finally implement support for IDLE, if server supports it (reason: reduce syncing overhead)

Other items, like syncing message flags, offline archiving of messages, and tree-view of IMAP folders, will probably be addressed in this rewrite, as well.

He's seeking constructive criticism, as he's unfamiliar with the IMAP protocol. Comments should either be posted as comments here or directed as followups to his post in opera.beta.