Postfix and G Suite Split delivery

Hello all,
I have a box with several virtual servers.
One of my customers has some educational mail accounts, and they want to use G Suite. So they have configured G Suite and added those mail accounts there. On my machine I have several other mail accounts (not educational) for this domain.
And Google send a link so we could configure the split mail delivery on G Suite, so the mail accounts added on G Suite receive their messages, and the other are routed to our server. ( [])).
I’ve changed the domain MX records pointing to Google MX records, and I did the configuration, and it works. Mail sent to email accounts that were added on G Suite get their messages there, and the other accounts get the messages on our server. Very cool.

But the problem now is when a domain account tries to send a message to one of the G Suite accounts it is delivered locally by Postfix, or fails (some G Suite accounts does not existe locally).
My question is: how do I configure Postfix to always use the servers on MX records to deliver the message, even it is locally hosted domain? It should deliver locally mail routed by GMail though.
Or does anyone know how to make this work?

Thank you
Rogerio Brito

If you are using a third-party / registrar DNS service then you must also configure your local instance of BIND to use Google MX via Virtualmin.

Additionally you might have to tweak the Postfix config file to add
sender_dependent_relayhost_maps = hash:/etc/postfix/relayhost_maps
and then create a relayhost_maps file and add something like []:587
and then
postmap /etc/postfix/relayhost_maps
and restart Postfix

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.