[Dovecot] Re: New mail sometimes fails to appear

Timo Sirainen tss at iki.fi
Sun Feb 5 13:46:16 EET 2006

On Sun, 2006-02-05 at 12:06 +0200, Tom Alsberg wrote:
> In the meanwhile, getting deeper into the sequence of calls when new
> mail arrives, I have traced the issue to be related the following in
> imap_sync_deinit(...):
> 	if (status.messages != ctx->messages_count) {
> 		client_send_line(ctx->client,
> 			t_strdup_printf("* %u EXISTS", status.messages));
> 	}
> 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? 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

> 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...

ctx->messages_count is decreased whenever expunges happen (which is the
only way to change/replace a mail), so the above checks works correctly.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20060205/9869fcc9/attachment.pgp

More information about the dovecot mailing list