We don't really fix issues with mbox files anymore, other than read issues.. Our focus is enabling people to move to other formats, such as maildir. I would strongly recommend you to consider using maildir instead of mbox.
Ugh, so many people still have their mail in mbox that I find it hard to believe this is "deprecated".
I would also recommend you use dovecot-lda in procmail to deliver mail, if you are not already doing so.
I wasn't, so it took me a couple days to try this and wait for it to happen again. It's still happening. I therefore think this probably doesn't have anything todo with procmail.
So please put mbox code read only, or kill it. Corruption is not acceptable. At it is not at the expected level or quality dovecot used to be or claim to be.
You'll get a lot of pushback if you do this! I'm not the only one using it. mailx and the gnu mail tools use it and I don't know if I can so easily migrate things to maildir format. I think it could be a nightmare migrating to maildir.
I am not sure what's going on with that, hard to say without knowing more about how the system is set up and configured.
First, yes I agree that it's only the cache files, not the mbox. Just removing the cache files causes dovecot to recreates them. There's no lost mail, it's just annoying and makes mail freeze.
My setup does not seem complex on the server side. It's dovecot using mbox files and local users, no virtual users. All the users are in the password file. It seems to be using Debian's default locking scheme which is set by the package.
I'm now using dovecot's 'deliver' to append messages to my mbox from procmail. I do sometimes use mutt to access the mbox but I was pretty careful not to actually write out or change the mbox today. Mutt locks the mbox when it writes so it shouldn't be a problem in theory.
I seem to be or may be the only one on this server seeing the issue. I am also a heavy imap user. At any given time, I have 2 to 4 IMAP connections happening to my mailbox. One from my laptop, one from my desktop, 2 from my phone: one from K9, a second backup one from the gmail app. I'm using Windows 10 mail on the computers and sometimes Outlook.
I'm definitely the only one using the k9 app on this server.
Is there any way 2 separate IMAP clients talking to dovecot could cause this? Is there something in the configuration that I should be setting when I have multiple IMAP clients to be more stringent on the locking so one doesn't stomp on the other inside of Dovecot?
I'm really hoping that this is just some config issue.