Difference between revisions of "Relay per Domain"
(New page: == Relay per domain == Currently Zimbra allows relaying emails to a specific server only, i.e using zimbraMtaRelayHost. However, there are needs to relay emails per domain basis. For exam...) |
|||
Line 1: | Line 1: | ||
− | = | + | Reference bug: http://bugzilla.zimbra.com/show_bug.cgi?id=32740 |
− | |||
− | + | Zimbra allows relaying emails to a specific server only, i.e using zimbraMtaRelayHost. However, there are needs to relay emails per domain basis. For example, you want emails sent by users@domain1.com should be relayed through smtp.domain1.com and users@domain2.com through smtp.domain2.com servers. You can configure it using "sender_dependent_relayhost_maps". | |
+ | |||
+ | '''This is an example and tested on ZCS 5.0.16''' | ||
1. Add following line to /opt/zimbra/postfix/conf/main.cf | 1. Add following line to /opt/zimbra/postfix/conf/main.cf | ||
− | sender_dependent_relayhost_maps = hash:/opt/zimbra/postfix/conf/bysender | + | ''sender_dependent_relayhost_maps = hash:/opt/zimbra/postfix/conf/bysender'' |
2. Create file /opt/zimbra/postfix/conf/bysender and enter your domain names and relay server's IP addresses. | 2. Create file /opt/zimbra/postfix/conf/bysender and enter your domain names and relay server's IP addresses. | ||
− | @domain1.com [10.10.10.1] | + | ''@domain1.com [10.10.10.1]'' |
− | @domain2.com [20.20.20.1] | + | ''@domain2.com [20.20.20.1]'' |
3. Create the hash file. | 3. Create the hash file. | ||
− | postmap /opt/zimbra/postfix/conf/bysender | + | ''postmap /opt/zimbra/postfix/conf/bysender'' |
4. Change the permissions. | 4. Change the permissions. | ||
− | chown root.postfix /opt/zimbra/postfix/conf/bysender /opt/zimbra/postfix/conf/bysender.db | + | ''chown root.postfix /opt/zimbra/postfix/conf/bysender /opt/zimbra/postfix/conf/bysender.db'' |
5. Restart zmmtactl | 5. Restart zmmtactl | ||
− | zmmtactl stop | + | ''zmmtactl stop'' |
− | zmmtactl start | + | ''zmmtactl start'' |
6. Test by sending emails. | 6. Test by sending emails. | ||
− | Note: Above settings will not survive zimbra upgrades. Make sure you take backup of config files before upgrading. | + | '''Note: Above settings will not survive zimbra upgrades. Make sure you take backup of config files before upgrading.''' |
Revision as of 02:42, 5 June 2009
Reference bug: http://bugzilla.zimbra.com/show_bug.cgi?id=32740
Zimbra allows relaying emails to a specific server only, i.e using zimbraMtaRelayHost. However, there are needs to relay emails per domain basis. For example, you want emails sent by users@domain1.com should be relayed through smtp.domain1.com and users@domain2.com through smtp.domain2.com servers. You can configure it using "sender_dependent_relayhost_maps".
This is an example and tested on ZCS 5.0.16
1. Add following line to /opt/zimbra/postfix/conf/main.cf
sender_dependent_relayhost_maps = hash:/opt/zimbra/postfix/conf/bysender
2. Create file /opt/zimbra/postfix/conf/bysender and enter your domain names and relay server's IP addresses.
@domain1.com [10.10.10.1] @domain2.com [20.20.20.1]
3. Create the hash file.
postmap /opt/zimbra/postfix/conf/bysender
4. Change the permissions.
chown root.postfix /opt/zimbra/postfix/conf/bysender /opt/zimbra/postfix/conf/bysender.db
5. Restart zmmtactl
zmmtactl stop zmmtactl start
6. Test by sending emails.
Note: Above settings will not survive zimbra upgrades. Make sure you take backup of config files before upgrading.