Difference between revisions of "Relay per Domain"

Line 1: Line 1:
{{WIP}}{{Article Infobox|{{admin}}|{{ZCS 5.0}}|{{ZCS 7.0}}|{{ZCS 8.0}}}}Reference bugs: http://bugzilla.zimbra.com/show_bug.cgi?id=32740 and https://bugzilla.zimbra.com/show_bug.cgi?id=95348
+
{{BC|Community Sandbox}}
 
+
__FORCETOC__
 +
<div class="col-md-12 ibox-content">
 +
=Relay per Domain=
 +
{{KB|{{Unsupported}}|{{ZCS 8.0}}|{{ZCS 7.0}}|}}
 +
{{WIP}}
 +
Reference bugs: http://bugzilla.zimbra.com/show_bug.cgi?id=32740 and https://bugzilla.zimbra.com/show_bug.cgi?id=95348
  
 
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 users@domain1.com should be relayed through smtp.domain1.com and users@domain2.com through smtp.domain2.com servers. You can configure it using postfix's "sender_dependent_relayhost_maps".  
 
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 users@domain1.com should be relayed through smtp.domain1.com and users@domain2.com through smtp.domain2.com servers. You can configure it using postfix's "sender_dependent_relayhost_maps".  
Line 9: Line 14:
  
 
1. Add following line to /opt/zimbra/postfix/conf/main.cf
 
1. Add following line to /opt/zimbra/postfix/conf/main.cf
 
+
  '''Pre 8.5:'''
  Pre 8.5:
 
 
  ''sender_dependent_relayhost_maps = hash:/opt/zimbra/postfix/conf/bysender''
 
  ''sender_dependent_relayhost_maps = hash:/opt/zimbra/postfix/conf/bysender''
  8.5:
+
  '''8.5:'''
 
  ''sender_dependent_relayhost_maps = lmdb:/opt/zimbra/postfix/conf/bysender''
 
  ''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.
 
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]''
Line 25: Line 28:
  
 
3. Create the hash file.
 
3. Create the hash file.
 
 
  ''postmap /opt/zimbra/postfix/conf/bysender''
 
  ''postmap /opt/zimbra/postfix/conf/bysender''
 
  
 
4. Restart zmmtactl
 
4. Restart zmmtactl
 
 
  ''zmmtactl stop''
 
  ''zmmtactl stop''
 
  ''zmmtactl start''
 
  ''zmmtactl start''
  
 
5. Test by sending emails.
 
5. Test by sending emails.
 
 
 
  
 
{{Article Footer|ZCS 5.0.16|6/4/2009}}
 
{{Article Footer|ZCS 5.0.16|6/4/2009}}

Revision as of 20:46, 12 July 2015

Relay per Domain

   KB 2888        Last updated on 2015-07-12  




0.00
(0 votes)

Reference bugs: http://bugzilla.zimbra.com/show_bug.cgi?id=32740 and https://bugzilla.zimbra.com/show_bug.cgi?id=95348

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 users@domain1.com should be relayed through smtp.domain1.com and users@domain2.com 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  [20.20.20.1]

You can even add individual email IDs to relay their emails to specific relay host.

 user@domain.com [10.10.10.2]

3. Create the hash file.

postmap /opt/zimbra/postfix/conf/bysender

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: https://wiki.zimbra.com/index.php?title=Relay_per_Domain Date Modified: 2015-07-12



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