I'm trying to se up a mail server for a shared domain: half of the mailboxes are hosted on Gmail and the other half on a local server.
I installed iRedMail 1.6.0 and configured Gmail to send all unresolved @example.com users to the local server. It worked when the sender wasn't @example.com... if it was, mail got rejected because of the unauthenticated connection. Adding all gmail subnets to the mynetworks (both in main.cf and settings.py) solved this issue (any better solution?).
The real issue was making mails exit from the local postfix when the mailbox was remotely hosted.
I had to create a virtual mailbox map with the remote mailbox list (awful solution) to get past the "rcpt to:" command. Still after a while I got an undeliverable report:
Action: failed Status: 5.1.1 Diagnostic-Code: x-unix; user unknown
After some struggling, I found that adding also a transport map with about the same data of the virtual mailbox map (in the trasnport map I also have the local transport rule) made the issue disappear and the mails flow correctly.
Now, using 2 different address lists for the same job is even more awful. I'm looking for a more elegant solution like "forward any unresolved @example.com email to ...", as I have on Gmail. Any suggestion?
Thanks Dario