On Sun, Feb 05, 2006 at 01:46:16PM +0200, Timo Sirainen wrote:
As I understand, at this point, status.messages should be the number of messages in the mailbox, and ctx->message_count the number of messages last reported to the client.
Right. But have you checked the code in lib-storage/index/mbox/mbox-sync.c?
I'm checking it now. it seems to be reached much earlier through imap_sync_init -> mailbox_sync_init -> mbox_storage_sync_init. I don't quite understand the code there, yet, but I'm learning somewhat on Dovecot's working from it.
That's where it really does the mbox syncing and also checks again if mbox has changed before doing anything. Probably mbox_sync_has_changed() would be a good place to put some checks.
Will do that.
Any ideas on what the problem may be related to, though? Some further assistance on how to check and resolve this would be appreciated.
I'm quite sure this is a bug in Dovecot now... I can confirm it is not in the client as I see Thunderbird is really IDLE on the mailbox, and I can confirm it is not caused by any NFS caching, as I see that it does get the correct results from stat.
One thing that could help me - is there some documentation on the inner architecture of Dovecot? I.E. What all the structs and their fields are conceptually for, and all the abstractions defined and used?
Can you explain the role of the {imap,mailbox}_sync_init/{imap,mailbox}_sync_deinit functions? Some clear notion of that could help me understand what is going on.
On another note, shouldn't the EXISTS message be on IDLE sent whenever there is a change in the mailbox? After all, a message can be replaced or changed, in which case the number of messages will not be updated, but one would want the client informed on the change...
(This is not related to my problem here - which is evident when new mail arrives and thus the message count does increase, but anyway)
ctx->messages_count is decreased whenever expunges happen (which is the only way to change/replace a mail), so the above checks works correctly.
What about when a message is changed/replaced from outside of IMAP (i.e. a user has a mailer accessing the mailboxes through the filesystem)? I thought Dovecot was supposed to be safe to use concurrent with local mail access...
Thanks, cheers, -- Tom
-- Tom Alsberg - hacker (being the best description fitting this space) Web page: http://www.cs.huji.ac.il/~alsbergt/ DISCLAIMER: The above message does not even necessarily represent what my fingers have typed on the keyboard, save anything further.