Transport Table for external servers
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/yourtransportfile,proxy:ldap:/opt/zimbra/conf/ldap-transport.cf
zmcontrol stop 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.