# Postfix and G Suite Split delivery

**URL:** <https://forum.virtualmin.com/t/postfix-and-g-suite-split-delivery/105611>\
**Category:** Virtualmin\
**Created:** [May 8, 2020, 9:32pm UTC](https://forum.virtualmin.com/t/postfix-and-g-suite-split-delivery/105611 "2020-05-08T21:32:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rogeriobrito](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/rogeriobrito/32/523_2.png) [@rogeriobrito](https://forum.virtualmin.com/u/rogeriobrito)\
**Post date:** [May 8, 2020, 9:32pm UTC](https://forum.virtualmin.com/t/postfix-and-g-suite-split-delivery/105611/1 "2020-05-08T21:32:00Z")

</div>

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. ( [[https://support.google.com/a/answer/2685650](https://support.google.com/a/answer/2685650)])).  
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

---

<div class="post-metadata">

**Author:** ![calport](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/calport/32/44_2.png) [@calport](https://forum.virtualmin.com/u/calport)\
**Post date:** [May 9, 2020, 4:30am UTC](https://forum.virtualmin.com/t/postfix-and-g-suite-split-delivery/105611/2 "2020-05-09T04:30:10Z")

</div>

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  
`@eduwebsite.edu [xxx.xxx.xxx.xxx]:587`  
and then  
`postmap /etc/postfix/relayhost_maps`  
and restart Postfix

---

<div class="post-metadata">

**Author:** ![system](https://cdn.forum.virtualmin.com/uploads/default/original/2X/c/cd96d761e326db4b2bef94886a639109bd7a8e76.svg) [@system](https://forum.virtualmin.com/u/system)\
**Post date:** [June 8, 2020, 4:30am UTC](https://forum.virtualmin.com/t/postfix-and-g-suite-split-delivery/105611/3 "2020-06-08T04:30:13Z")

</div>

Closed on June 8, 2020, 4:30am UTC

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