it is a bit fuzzy thing I try to solve so I need to ask you for a help.
Our users are divided between two big buildings, that are far from each other, so we set up two independent mail servers so each server serves mail for its building. Main purpose is that in case of connectivity lost users are able to mail their colleagues within its own building even if external mail is temporarily not available. Each building uses its own mail domain. The setup is trivial and works fine.
For purpose of spam combat and also for administrative purposes we have the same (whole) user table on each server, but have each box marked as "B1" or "B2" to indicate which building given user located at. We used to store tables of mailboxes and redirects in SQL tables so no problem to distinguish them by adding "WHERE which_server='B1'" condition to exim configuration lines.
What was unexpected is mail duplication when we come to redirects/aliases. Here is the example:
Let's say user user1 in building 1 uses mailbox [email protected], while user user2 in building 2 uses mailbox [email protected]. No problem so far, they can send mail to each other and external users can also contact them by mail.
Let's now imagine we add some redirects on each mail server. Say like that:
[email protected] -> [email protected], [email protected], [email protected]
Now as mail from [email protected] goes to [email protected], mailserver on server1 will make three copy of it and send further as three separate messages (two gwill go to b2.domain.com's server, one will go to Gmail's servers). Now, when these messages are come to b2.domain.com's server, it will do the redirect again (using its own SQL tables), thus duplicating messages.
I fee I miss some elegant way to solve this so could you please point me out the right way?
Thanks in advance!