On Mon, 22 Jan 2007 18:55:33 +0200 Timo Sirainen tss@iki.fi wrote:
Thanks for the fast reply Timo!
TS> On Mon, 2007-01-22 at 17:38 +0100, Vadim Zeitlin wrote: TS> > * STATUS "test" (MESSAGES 41 RECENT 0 UNSEEN 0) TS> > 2 OK Status completed. TS> > [--- switch to another window and copy a message to the test folder ---] TS> TS> Copied using what program? Did it add X-UID or Status header?
Copied using my own MUA (Mahogany) which uses c-client library and is connected to the same (Dovecot) IMAP server, so the message is appended by Dovecot itself. It does have X-UID and "Status: R" headers but I thought they were appended by Dovecot itself, aren't they?
TS> > 3 status test (messages recent unseen) TS> > * STATUS "test" (MESSAGES 42 RECENT 1 UNSEEN 0) TS> > 3 OK Status completed. TS> TS> If you do it again, does it still show RECENT 1?
Yes. I did find a mention of an old (2003) bug which resulted in recent flag being unset after status command but it was apparently fixed a long time ago and, anyhow, status works just fine -- the problem only arises when the folder is opened.
TS> > Why does Dovecot send "0 RECENT" when the mailbox is opened when it had TS> > just told that there was a recent message in it? And why is the message TS> > effectively old (no \Recent in the FETCH reply)? Notice that if I look at TS> > the MBOX file I see "Status: R" until command number 7, it becomes "Status: TS> > RO" only when I log out -- but internally Dovecot clearly considers it to TS> > be old long before that. TS> TS> That is because it's using "lazy writes". You could try if setting TS> mbox_lazy_writes=no changes anything.
Well, yes, it does! This fixed the problem. I can live with this option being turned on, of course, but I'm still curious as to why it helped. It looks like some information is not being updated correctly somewhere if the file is not rewritten on disk immediately.
Anyhow, thanks for the hint about mbox_lazy_writes and I'd be glad to help you to debug the problem further if you're interested. Please let me know if you have any ideas about what would you like me to try (I can provide the full log of the IMAP session which copies the message too if this could be useful).
Thanks, VZ