Solved
I added a line to data/conf/dovecot/extra.conf as follows:
mail_attribute_dict = file:/var/vmail_index/%d/%n/dovecot-attributes
default: mail_attribute_dict = file:%h/dovecot-attributes
where %h is mail_home = /var/vmail/%d/%n
by default, but may differ depending on configuration.
Explanation
So. Mailcow uses two volumes for mail and mail indexes as stated in docker-compose.yml
- vmail-vol-1:/var/vmail
- vmail-index-vol-1:/var/vmail_index
vmail-vol-1 is mounted to obsfs (a s3fs based thing developed by huawei, I did not set up this instance myself and I don’t like this solution either) where email is stored. Indexes are stored locally, however. And as we saw, that the problem was that dovecot-attributes could not be properly locked, so I moved it to simillar location in index volume, which is stored locally and doesn’t have locking bugs.
Q: What is dovecot-attributes and why it matters here?
A: It’s a file that contains key-value database used usually with plugins, with Imap Metadata in this case to be exact. Which I presume stores folder structure and such, I’m no expert. See IETF Link
My vision of this is getting metadata is no problem, but deleting folders somehow involves this extension and writing to the dovecot-attributes file, so we had problems.
P.S.
Why Redis or memcached not used for this, we have both. How do I set it up with Redis, for example?
P.S.
Why Redis or memcached not used for this, we have both. How do I set it up with Redis, for example?