On Mon, 2008-10-20 at 16:16 +0200, Hans-Werner Paulsen wrote:
When I start my imap-client, I see the content of the INBOX, and I can read, delete, ... the different entries. But when new mail arrives dovecot (and my imap-client) will never notice this. And when I quit my imap-client the dovecot imap server will write back its view of the INBOX, and delete this new mail. This seems to be a problem related to AFS. I poked in the dovecot code and have the following theory: dovecot opens the INBOX R/W, dovecot calls "stat" on the INBOX file periodically to look for modifications. But this does not work, because this machine will stat the local copy (AFS cache) of the INBOX as long as this file is still open R/W.
I'd have thought that the local view was updated at least after fcntl locking the mailbox.
My questions: Is it possible to have a configuration, that the INBOX file is not left open when stat-ing this file? Or is it possible to open the INBOX file R/W only when it us locked? Or is it necessary to modify the code?
It's necessary to modify the code. Probably not difficult (maybe in mbox_unlock()), but I'd rather not change that code permanently since this is a pretty AFS-specific problem..