About our setup: These are on an nfs-mounted file system. It's shared between two computers and connections are randomly redirected to either box; so potentially it could be an nfs type corruption issue. Timo, I'll send you a tarball of the dovecot* files off-list
Sounds like it could be because of NFS caching issues. You've set mail_nfs_index=yes, right? What OS? Linux should be OK, but FreeBSD has some issues.
Thanks for the patch; I've not seen any issues to do with nfs caching before and we've had this live on very heavily loaded systems for several months now. We use exim with deliver to deliver the messages (maildir only). Relevant config:
mail_location: maildir:~/Maildir mmap_disable: yes mail_nfs_storage: yes mail_nfs_index: yes lock_method: dotlock maildir_copy_preserve_filename: yes
Linux (centos5.2 w/updates). Mount options: rw,noatime,nodiratime,hard,intr,rsize=32768,wsize=32768,tcp,nocto
Mark