[Dovecot] Retrieving unread message count

Brandon Davidson brandond at uoregon.edu
Mon Oct 18 01:49:58 EEST 2010


Timo,

I'm working with a webmail client that periodically polls unread message
counts for a list of folders. It currently does this by doing a LIST or LSUB
and then iterating across all of the folders, running a SEARCH ALL UNSEEN,
and counting the resulting UID list.

Eventually I'd like to see it using RFC5819 LIST-EXTENDED, but that requires
a fair bit of work. In the mean time I'm trying to speed up the existing
iteration. I've got it working using 'STATUS "mailbox" (UNSEEN)', but the
language in RFC3501 suggest that this may be slow. There is a
counterproposal to use RFC4731 ESEARCH and do 'SELECT "MAILBOX"'; 'SEARCH
RETURN (COUNT) UNSEEN'.

>From an IMAP server perspective, which do you anticipate would be faster?
>From a client perspective it seems like STATUS would be better since it
involves less round-trips to the server and less output parsing, but given
the warnings in the RFCs there is concern that it is in fact be more
expensive.

-Brad



More information about the dovecot mailing list