So, I want to create my own mailserver. So far, I have setup Postfix as MTA and starting to implement Dovecot as MDA. But here, I have a question.
In one container, I will have postfix, and in other, dovecot. So dovecot is responsible for delivering emails (from postfix), to recipient mailbox. So if I have mx entry for example.com, message will be sent to my postfix, and dovecot will fetch this message, and show it to our end user correct? Lets say, that dovecot + postfix container is only one cluster. What if we have clusters, and load balancer in front of all this clusters?
So when I say "Get new message" from mail UI, request will go through load balancer, and it will connect to appropriate cluster, and this does not mean that I will get all the messages. Maybe there are some messages on other cluster postfix container right?
So my question is how to fix this? Is there any sort of replication for this stuff? Should I use database? What is the proper architecture for this kind of problems here?