Relay per Domain
From Zimbra :: Wiki
|- This article is a Work in Progress, and may be unfinished or missing sections.|
|This article applies to the following ZCS versions.|
Zimbra allows relaying emails to a specific server only, i.e using zimbraMtaRelayHost. However, there are needs to relay emails per domain basis based on the sender. For example, you want emails sent by email@example.com should be relayed through smtp.domain1.com and firstname.lastname@example.org through smtp.domain2.com servers. You can configure it using postfix's "sender_dependent_relayhost_maps".
This is an example that has been tested on ZCS 5.0.16 and ZCS 7.1.4
Note: Below settings will not survive zimbra upgrades. Make sure you take backup of config files before upgrading.
1. Add following line to /opt/zimbra/postfix/conf/main.cf
Pre 8.5: sender_dependent_relayhost_maps = hash:/opt/zimbra/postfix/conf/bysender 8.5: sender_dependent_relayhost_maps = lmdb:/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 [126.96.36.199]
You can even add individual email IDs to relay their emails to specific relay host.
3. Create the hash file.
4. Restart zmmtactl
zmmtactl stop zmmtactl start
5. Test by sending emails.
|Verified Against: ZCS 5.0.16||Date Created: 6/4/2009|
|Article ID: http://wiki.zimbra.com/index.php?title=Relay_per_Domain||Date Modified: 03/31/2015|