[Dovecot] imap idle on non-inbox?

Timo Sirainen tss at iki.fi
Fri Oct 22 19:01:49 EEST 2004


On 22.10.2004, at 18:40, Johannes Berg wrote:

> On Tue, 2004-10-19 at 02:22 +0300, Timo Sirainen wrote:
>> Anyway .. How is that feature useful with offlineimap? And why 
>> couldn't
>> you implement it by just making it send STATUS for each mailbox every
>> few minutes? Without the mailbox index that's pretty much the way it
>> would have to be done in Dovecot internally (unless you use dnotify
>> with maildir).
>
> Actually, I misunderstood what you were saying. What I'm looking for is
> a notification when dovecot detects a new email.
> For some reason I thought it might be RFC-conforming to send an 
> untagged
> STATUS on changes, even if the client didn't explicitly ask for it. But
> that probably just shows my ignorance of the IMAP RFC.

It is allowed, it's just not very easy to implement.

> The point is that offlineimap is nice for the first sync, but all syncs
> after that are horribly slow because it keeps rescanning all (big)
> folders. Since I am sync'ing between two dovecots (one local, one on 
> the
> mail server) I figured it'd be far more efficient if offlineimap just
> waited to see if any of them reported any changes somewhere and then
> propagated those to the other side.

You could do the "waiting" by polling all the available mailboxes with 
eg. STATUS (MESSAGES NEXTUID) every few minutes. If either of those 
values changed since last check, it would indicate something happened 
to the mailbox. Dovecot should reply to the STATUS commands fast if 
nothing has changed.

Requires no modifications to Dovecot and works with all IMAP servers :)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20041022/7be85efa/PGP-0001.pgp


More information about the dovecot mailing list