http://hg.dovecot.org/dovecot-2.2-notify/ contains the initial implementation of
IMAP NOTIFY extension. It's less than half-working, but the difficult part
of it is done I think. If I give it a command like:
x notify set (personal (messagenew messageexpunge flagchange))
and then in another session I copy a message to another mailbox, it sends:
* STATUS "foobar" (MESSAGES 77 UIDNEXT 78 UIDVALIDITY 1329431281
UNSEEN 75)
This requires mailbox_list_index=yes to work. It works by following the
dovecot.list.index.log changes, so it's going to be pretty efficient. Some
TODO that I've so far noticed:
- NOTIFY is handled currently only for non-selected mailboxes. (handling the
new features for selected mailbox should be simple)
- initial STATUS sending isn't done with STATUS option
- only MessageNew, MessageExpunge and FlagChange notifications are sent
currently
- MailboxName handling probably needs to be able to get "old" and
"new" views, figure out what changed in them and send those changes
(dsync has similar code)
- mailbox list indexes seem to be adding too much stuff, which results in:
- STATUS duplicates, but there should already be code to avoid these so I'm
not sure what's going on
- ACLs and shared mailboxes don't work right
- add 0.5s delay before notifying IMAP code, so multiple changes can be bundled
into one