Sorry for starting a new threat. I've been Googling for about 6 months, and I searched through lots of forums, and can't find the answer I'mn looking for.
A bit of history. I used to work for a company whom used their own flavour of Gentoo Linux. We used Exim with Cyrus. It was easy to do what I'm now struggling to do on Virtualmin.
Here is the scenario: My client, lets call their domain purpleapple.com, has 2 different offices. Each office has their own mail server. Both offices uses the same domain.
Above are just examples!
More details: purpoleapple.com's MX records point to the ISP. Each office's mail server POP's mail from the ISP (at 2 minute intervals).
We had several ways of setting this up, but in most cases we used to drop mail sent to a user unknown to Office 1's server. Office 2's mail server would drop mail destined for Office 1's users.
Further, if a user from Office 1 sent a mail to a user at Office 2 (using Office 1's server as SMTP), Office 1 would know the user doesn't exist at Office 1, and sent that mail to the ISP. Office 2's server would then grab that mail at its next poll.
In same cases we had Exim setup to deliver directly to the second office's mail server etc.
Like I said, it was fairly simple and logical to do.
Now heres my problem, I'm trying to do exactly the same with Virtualmin, Postfix and Dovecot. My first idea was to change the conf so that mail to any unknown mailbox gets delivered to the ISP (or wherever the MX are pointed). Unfortunately I couldn't get this working. I tried setting up mail routing etc, but theres really not much info available on this.
I ended up with a very nasty hack, which is still working (and hey, I was desperate!) Currently, both servers POP from the ISP, so inbound mail is fine. The problem comes in when someone from Office 1 sends a mail to someone at Office 2. So my hack for this was to create all users at all branches. All the users NOT at the branch, gets a forwarder so their mail gets delivered to a completely different domain (I used my own mail server for this purpose, just to get the client going). Then the correct server pop's that account.
A bit more detail on how I configured Virtualmin: I'm using Webmin Cluster to replicate the users. Then I go to Virtualmin to enable the user's mailbox. Both servers have a Virtual Server setup in Virtualmin, called purpoleapple.com.
I thought of naming those virtual servers office1.purpoleapple.com and office2.purpoleapple.com, but that seems to bring a whole new problem to the mix.
Could someone please guide me in the correct or ideal way of setting this up?
Ideally, all mail servers for the domain should be aware of each other, and deliver mail between themselves. BUT, there are cases where I would do the IT work for the client's say Cape Town branch, and another IT company would manage the client's Johannesburg branch. For this reason I feel the easiest way to get this working, is for the mail server to send mail not destined for any of its users back to the ISP.
Thanks all for your help!!!