Hello Postfix Community!
I have several email addresses @
mydomain.com that are hosted by Google. They were initially set up as the primary G-Suite domain. I now need to route some emails addressed to this domain to another mail service, the proposal being a self-hosted mail server with Postfix that my team administers and maintains.
There will be new users receiving mail at the self-hosted mail server, but I wish to relay mail for the existing set of users back to Google and point the final delivery to the Google MX records. I believe that I can relay these emails through Postfix, but because the DNS MX records for the domain will be pointing at the new Postfix server, I am unsure of how to handle filtering and delivering emails for this set of users back to Gmail without looking up DNS MX records. I would also like to maintain the from address of the original sender.
So, my questions are ultimately:
1. How would I go about filtering inbound mail and then delivering to either the local mailboxes or Google, dependent on the user (or perhaps dependent on whether a local user exists or not)?
2. How do I deliver to Gmail when the DNS MX records for the domain are already pointing to the private mail server?
As a side note, once I understand how to set up this filtering and relaying of inbound emails to Google, I will need to add another relay pointing to Microsoft Online for another set of users.
I apologize if this is already covered in the documentation, I am new to Postfix so I did not recognize what features could be used to accomplish this. Thank you for any guidance.
-Marisa