> On Oct 21, 2022, at 5:23 PM, hi@zakaria.website wrote:
>
> I was wondering if one can achieve the same implementation with haproxy
> without dovecot director?
The most important part of Director is it makes sure same mail user always
proxied to same backend IMAP server.
If mailbox is in Maildir format (and stored on shared storage like NFS),
accessing it from different server may corrupt Dovecot index files and mailbox
becomes unaccessible. Director perfectly avoids this issue.
HAProxy can proxy mail user from same client IP to same backend IMAP server,
but not same mail user from different IPs.
Quote (https://doc.dovecot.org/admin_manual/director/dovecotdirector/):
"Director can be used by Dovecot’s IMAP/POP3/LMTP proxy to keep a temporary
user -> mail server mapping. As long as user has simultaneous connections, the
user is always redirected to the same server. Each proxy server is running its
own director process, and the directors are communicating the state to each
others. Directors are mainly useful for setups where all of the mail storage is
seen by all servers, such as with NFS or a cluster filesystem."
----
Zhang Huangbin, founder of:
- iRedMail: Open source email server solution: https://www.iredmail.org/
- Spider: Lightweight, on-premises Email Archiving Software: https://spiderd.io