Route local domains to external gateway

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
Post Reply
brtk
Posts: 16
Joined: Fri Jul 12, 2019 12:45 pm
Location: Toronto
Contact:

Route local domains to external gateway

Post by brtk »

I am straggling to get this going. I have multi server deployment with 4 local domains. I have server MTA and configured relay to external gateway. Requirement is that all domains even local get routed to external gateway first. All mail is routed to external gateway and only local domain route locally and I cant get them to go out. I tried using MX records pointing MX for local domain to gateway but that did not work. i tried using routemaps but could not that to work also. What is the best way to achieve this ? Thanks in advance for all responses
Uma Shankar
Posts: 40
Joined: Wed Jun 01, 2016 5:01 am

Re: Route local domains to external gateway

Post by Uma Shankar »

Hi,

You can use zimbraTransportMaps to achieve this

su - zimbra

vi /opt/zimbra/common/conf/transportfile

domain1.com :[relay.example.com]
domain2.com :[relay.example.com]
user1@domain3.com :[relay.example.com]

postmap /opt/zimbra/common/conf/transportfile

zmprov ms mail.example.com zimbraMtaTransportMaps "lmdb:/opt/zimbra/common/conf/transportfile"


This will help you achieve the requirement for local domains as well. Do remember to mention the local domains in the transportfile.
brtk
Posts: 16
Joined: Fri Jul 12, 2019 12:45 pm
Location: Toronto
Contact:

Re: Route local domains to external gateway

Post by brtk »

Thanks so much, I will try this today
brtk
Posts: 16
Joined: Fri Jul 12, 2019 12:45 pm
Location: Toronto
Contact:

Re: Route local domains to external gateway

Post by brtk »

Uma Shankar wrote:Hi,

You can use zimbraTransportMaps to achieve this

su - zimbra

vi /opt/zimbra/common/conf/transportfile

domain1.com :[relay.example.com]
domain2.com :[relay.example.com]
user1@domain3.com :[relay.example.com]

postmap /opt/zimbra/common/conf/transportfile

zmprov ms mail.example.com zimbraMtaTransportMaps "lmdb:/opt/zimbra/common/conf/transportfile"


This will help you achieve the requirement for local domains as well. Do remember to mention the local domains in the transportfile.

Forgot to ask , will this work for version 8.8 ? Thanks
brtk
Posts: 16
Joined: Fri Jul 12, 2019 12:45 pm
Location: Toronto
Contact:

Re: Route local domains to external gateway

Post by brtk »

also how would i route mail to local domains ?
localdomain :[mbxserver] # is this it ?
Uma Shankar
Posts: 40
Joined: Wed Jun 01, 2016 5:01 am

Re: Route local domains to external gateway

Post by Uma Shankar »

Hi,

Yes, this will work with ZCS 8.8.*

Also, for local domains you need to make an entry in the transport file as

localdomain : [externalgateway]
Post Reply