Ive got two servers with a shared glusterfs disk, both running dovecot and serving mail from this shared disk. Users read mail only from one of these servers but mail gets delivered to both. Occasionally I get problems when accessing the inbox maildir folder:
IMAP(user): open(/home/user/Maildir/dovecot-uidlist) failed: Permission denied
The user cant open the inbox. Accessing other folders works fine. If I delete the dovecot index files and restart dovecot everything works fine.
What can I do to make this setup more reliable?
My dovecot settings on both servers:
mmap_disable = no
dotlock_use_excl = yes
mail_nfs_storage = yes
mail_nfs_index = no
If all else fails I could create a bash script to clean up dovecot index files if there are errors in the logs...
I have glusterfs deployed for a few projects, not using it though as the backend storage for IMAP/SMTP storage.
But from experience can say a few things:
First of all I would not recommend anyone use distributed file systems for storage backend on high transactional workloads such as IMAP and SMTP. Since they do not work with them well , mostly because of two reasons: high latency and problems with file locking.
Secondly, have spent quite some time on gluster freenode channel seen people reporting about Dovecot complaining about constant index corruption gluster does. So i would strongly recommend you to utilize some other back storage replication solution, dsync replication or something similar.
Hope this helps.
I think you should put mail_nfs_index = yes, and ensure use a proxy that redirects the same IP to the same backend server always. This link can help: https://wiki.dovecot.org/MailLocation/SharedDisk