Transport Table for external servers: Difference between revisions

No edit summary
No edit summary
 
(11 intermediate revisions by 5 users not shown)
Line 1: Line 1:
Configuring transport tables to relay all emails to an different mail server. In this example I am forwarding all emails for otherdomain.com to smtp.otherdomain.com . You can add many transport maps as per your need. All commands should be run as Zimbra. Please check for 5.x instructions described inline.
{{Archive}}={{Article Infobox|{{admin}}|{{ZCS 6.0}}|{{ZCS 5.0}}|}}Configuring transport tables to relay emails to a different mail server. In this example I am forwarding all emails for otherdomain.com to smtp.otherdomain.com . You can add as many transport maps as you need. All commands should be run as a user 'zimbra'. After 5.0.9, postfix_transport_maps has been modified a bit, so we'll show both ways.


  ''$ zmlocalconfig  |grep -i postfix_transport_maps''
  ''$ zmlocalconfig  |grep -i postfix_transport_maps''


This will show you current transport maps file configuration (4.x).
This will show you the current transport maps file configuration:


  ''postfix_transport_maps = ldap:/opt/zimbra/conf/ldap-transport.cf''
  ''postfix_transport_maps = ldap:/opt/zimbra/conf/ldap-transport.cf''


On 5.x Systems
or for Zimbra 5.0.9 and higher (including 6.0):
 
  ''postfix_transport_maps = proxy:ldap:/opt/zimbra/conf/ldap-transport.cf''
  ''postfix_transport_maps = proxy:ldap:/opt/zimbra/conf/ldap-transport.cf''


Create your transport file (owner/group-owner should be zimbra). You can also add multiple transport maps.
Create your transport file (owner/group-owner should be zimbra):


  ''vi /opt/zimbra/postfix/conf/transportfile''
  ''vi /opt/zimbra/postfix/conf/transportfile''
  ''otherdomain.com    :[smtp.otherdomain.com]''
  ''otherdomain.com    :[smtp.otherdomain.com]''


Convert the transport file into maptype database file.
You can also add multiple transport maps, for example:
 
''mydomain.com    :[mail.otherdomain.com]''
''mydomain.org    :[mail.otherdomain.com]''
''hisdomain.net    :[mail.otherdomain.com]''
 
In this example all emails for 3 different domains will go to mail.otherdomain.com, so destination will be changed, while user name will remain as in original email address.
 
Convert the transport file into maptype database file:


  ''$ postmap /opt/zimbra/postfix/conf/transportfile''
  ''$ postmap /opt/zimbra/postfix/conf/transportfile''


Define new transport file instead of the default one (4.x).
The file transportfile.db will be created in this directory. Define the new transport file (original, not *.db one) BEFORE the default one. Run:


  ''$ zmlocalconfig -e postfix_transport_maps=hash:/opt/zimbra/postfix/conf/yourtransportfile,ldap:/opt/zimbra/conf/ldap-transport.cf''
  ''$ zmlocalconfig -e postfix_transport_maps="hash:/opt/zimbra/postfix/conf/transportfile ldap:/opt/zimbra/conf/ldap-transport.cf"''


For 5.x
Or for Zimbra 5.0.9 and higher:


  ''$ zmlocalconfig -e postfix_transport_maps=hash:/opt/zimbra/postfix/conf/yourtransportfile,proxy:ldap:/opt/zimbra/conf/ldap-transport.cf''
  ''$ zmlocalconfig -e postfix_transport_maps="hash:/opt/zimbra/postfix/conf/transportfile proxy:ldap:/opt/zimbra/conf/ldap-transport.cf"''


Restart Zimbra
Finally, make sure that the relay_domains parameter in main.cf contains all domains handled by the server, whether locally or relayed elsewhere:
''$ vi /opt/zimbra/postfix/conf/main.cf
''relay_domains = otherdomain.com, mydomain.com, mydomain.org, hisdomain.net, locallyhandleddomain.com, localaliaseddomain.com''
 
Restart Zimbra:


  ''zmcontrol stop''
  ''zmcontrol stop''
  ''zmcontrol start''
  ''zmcontrol start''


This will forward all emails for otherdomain.com and its subdomains to host smtp.otherdomain.com However you'll need to be careful at zimbra upgrades. The modification will be overwritten by the upgrade. If you still not able to set the correct transport tables, contact Zimbra Support.
This will forward all emails for the example domains and subdomains to host smtp.otherdomain.com while allowing local domains to continue to be delivered locally. However you'll need to be careful at zimbra upgrades. The modification to main.cf for relay_domains will be overwritten by the upgrade. If you still not able to set the correct transport tables, contact Zimbra Support.
 
 
{{Article Footer|ZCS 5.0.9|08/13/2008}}
{{Article Footer|ZCS 6.0.5|04/07/2010}}
[[Category:Configuration]]
[[Category:MTA]]
[[Category:Command Line Interface]]
[[Category:ZCS 5.0]]
[[Category:ZCS 6.0]]

Latest revision as of 16:16, 27 March 2015

=

Admin Article

Article Information

This article applies to the following ZCS versions.

ZCS 6.0 Article ZCS 6.0 ZCS 5.0 Article ZCS 5.0

Configuring transport tables to relay emails to a different mail server. In this example I am forwarding all emails for otherdomain.com to smtp.otherdomain.com . You can add as many transport maps as you need. All commands should be run as a user 'zimbra'. After 5.0.9, postfix_transport_maps has been modified a bit, so we'll show both ways.

$ zmlocalconfig   |grep -i postfix_transport_maps

This will show you the current transport maps file configuration:

postfix_transport_maps = ldap:/opt/zimbra/conf/ldap-transport.cf

or for Zimbra 5.0.9 and higher (including 6.0):

postfix_transport_maps = proxy:ldap:/opt/zimbra/conf/ldap-transport.cf

Create your transport file (owner/group-owner should be zimbra):

vi /opt/zimbra/postfix/conf/transportfile
otherdomain.com     :[smtp.otherdomain.com]

You can also add multiple transport maps, for example:

mydomain.com     :[mail.otherdomain.com]
mydomain.org     :[mail.otherdomain.com]
hisdomain.net    :[mail.otherdomain.com]

In this example all emails for 3 different domains will go to mail.otherdomain.com, so destination will be changed, while user name will remain as in original email address.

Convert the transport file into maptype database file:

$ postmap /opt/zimbra/postfix/conf/transportfile

The file transportfile.db will be created in this directory. Define the new transport file (original, not *.db one) BEFORE the default one. Run:

$ zmlocalconfig -e postfix_transport_maps="hash:/opt/zimbra/postfix/conf/transportfile ldap:/opt/zimbra/conf/ldap-transport.cf"

Or for Zimbra 5.0.9 and higher:

$ zmlocalconfig -e postfix_transport_maps="hash:/opt/zimbra/postfix/conf/transportfile proxy:ldap:/opt/zimbra/conf/ldap-transport.cf"

Finally, make sure that the relay_domains parameter in main.cf contains all domains handled by the server, whether locally or relayed elsewhere:

$ vi /opt/zimbra/postfix/conf/main.cf
relay_domains = otherdomain.com, mydomain.com, mydomain.org, hisdomain.net, locallyhandleddomain.com, localaliaseddomain.com

Restart Zimbra:

zmcontrol stop
zmcontrol start

This will forward all emails for the example domains and subdomains to host smtp.otherdomain.com while allowing local domains to continue to be delivered locally. However you'll need to be careful at zimbra upgrades. The modification to main.cf for relay_domains will be overwritten by the upgrade. If you still not able to set the correct transport tables, contact Zimbra Support.


Verified Against: ZCS 5.0.9 Date Created: 08/13/2008
Article ID: https://wiki.zimbra.com/index.php?title=Transport_Table_for_external_servers Date Modified: 2015-03-27



Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »


Verified Against: ZCS 6.0.5 Date Created: 04/07/2010
Article ID: https://wiki.zimbra.com/index.php?title=Transport_Table_for_external_servers Date Modified: 2015-03-27



Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »

Jump to: navigation, search