Zimbra Custom Transport Maps

Posted by blogadmin on August 8, 2012

When there is more than one MTA in an organisation, you need transport maps to tell each MTA where to route mails. We had Lotus Notes and Zimbra. There is an option in Lotus Notes to send mail of non-existing users to external SMTP server. In Zimbra we can you postfix transport maps to use different SMTP gateway for specific users.

1. Login on Zimbra server and run below command as zimbra user

zimbra@mbox01-bom:~$ zmlocalconfig|grep postfix_transport_maps
postfix_transport_maps = proxy:ldap:${zimbra_home}/conf/ldap-transport.cf

This shows zimbra checkes LDAP for transport maps

2.Zimbra overwrites main.cf file when restarted, so manual changes made will vanish on next restart. “zmlocalconfig” is the command to make your changes permanent. We will add one more transport look up source like below

zmlocalconfig -e postfix_transport_maps=hash:/opt/zimbra/postfix/conf/transport_internal,proxy:ldap:${zimbra_home}/conf/ldap-transport.cf

3. Add following entries in file /opt/zimbra/postfix/conf/transport_internal

user1@domain.com  smtp:exchange01.domain.com # Send mails of user1 to exchange01 server
user2@domain.com  smtp:cyrus01.domain.com # Send mails of user1 to cyrus01 server
user3@domain.com  smtp:lotus01.domain.com # Send mails of user3 to lotus01 server
user4@domain.com  smtp:[custom.domain.com]:30 # Send mails of user4 to custom server on port 30

Left hand side is the email-id. Right hand side is the destination mail server to send mails for that user.
user4@domain.com smtp:[custom.domain.com]:30 This will send mail to port 30 (default is 25) of server custom.domain.com. “[]” suppress MX lookups

4. Save the file change the owner to Zimbra

chown zimbra:zimbra /opt/zimbra/postfix/conf/transport_internal
chmod 644 /opt/zimbra/postfix/conf/transport_internal

5. As user zimbra run command

postmap /opt/zimbra/postfix/conf/transport_internal

6. Restart zimbra

/etc/init.d/zimbra stop
/etc/init.d/zimbra start

7. There is one more method to do this. But using above method you can control user and domain specific transports.

zmprov ma user1@domain.com zimbraMailTransport smtp:server1.example.com:25
Share Button

Filed under System Administration

Tagged , , ,

2 thoughts on “Zimbra Custom Transport Maps

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>