[Dovecot] IMAP IDLE, Virtual mailboxes

Patrick Nagel patrick.nagel at star-group.net
Fri Apr 9 09:31:59 EEST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

K-9 Mail (on Android) has been mentioned on this list multiple times
recently, I think it's definitely an IMAP client "on the rise". :) It
supports IMAP IDLE, and so brings "push mail" to Android mobile phone
users. To bring this into the context of this mailing list: I guess a
lot of people on this list are making use of server-side filtering
(using sieve), so that mails from certain persons or mailing lists end
up in the right mailboxes, right on delivery. Now, this is all great,
but there are issues when server-side filtering and IMAP IDLE come
together: Only one mailbox can be "watched" with one IMAP IDLE
connection. So, people who have set up elaborate server-side filtering
with say, 50 different sieve "fileinto" calls, will constantly have a
*lot* of IMAP IDLE connections open, if they really want to get informed
of any mail arriving in any of their mailboxes.

Keeping those 50 IMAP connections open wouldn't cost much bandwidth, and
who cares about the Internet router's connection tables getting
unnecessarily big, anyway? But then there is the "problem" of a mobile
phone being carried around constantly, switching physical connections
(from WLAN access point 1 to WLAN access point 2 to 3G to 2G to no
connection at all and back), every time needing to terminate* those 50
IMAP connections, and then establish 50 new ones (with SSL handshake
overhead and all). So, all in all, not an optimal solution.

*) (which does not always happen the way it should, see
http://code.google.com/p/k9mail/issues/detail?id=1255)

I see two ways to improve the situation (one of them quite dovecot-centric):
1) A new extension of the IMAP protocol: IMAP MULTI-IDLE, which somehow
allows a client to get notified of changes to more than one mailbox
within one IMAP connection. This conflicts with the basic IMAP design
though, AFAIK, and is thus not likely to be feasible.
2) Enhancing dovecot's Virtual plugin, so virtual mailboxes do not only
get updated on select and expunge, but also when anything changes that
affects the set of messages shown in the virtual mailbox. I guess that
would have an impact on performance, and thus should be optional.

Let me explain the second one: With the help of the Virtual plugin, it
is possible to pull all those 50 mailboxes that receive incoming mail
together again, just like the INBOX of the pre-server-side-filtering
times - the user could configure a virtual mailbox to show all unread
mails from those 50 mailboxes. Now the mobile IMAP IDLE users could just
watch that one virtual mailbox, needing only one IMAP IDLE connection.
After having read the mail (directly in the virtual mailbox), it would
disappear, but of course still be in the "real" mailbox, determined by
the sieve filter on delivery.

Patrick.

- -- 
STAR Software (Shanghai) Co., Ltd.            http://www.star-group.net/
Phone:    +86 (21) 3462 7688 x 826             Fax:   +86 (21) 3462 7779

PGP key E883A005 https://stshacom1.star-china.net/keys/patrick_nagel.asc
Fingerprint:           E09A D65E 855F B334 E5C3 5386 EF23 20FC E883 A005
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/

iEYEARECAAYFAku+ydsACgkQ7yMg/OiDoAXV9ACdF+BEstnjfUeJlR/JQKFf6N7n
yxYAnAnuD2popWYLfZNCCtlpkAP4SQww
=L33A
-----END PGP SIGNATURE-----


More information about the dovecot mailing list