Sending mail through an external relay

Revision as of 20:22, 14 September 2010 by Greg (talk | contribs) (→‎Global Settings)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Overview

Zimbra server can route outgoing mail through an external relay MTA. This feature is useful when running a Split Domain during migration, when you need to route all outgoing mail through your ISP's MTA or just need to route all mail through another MTA for whatever reason. Relay MTA can be configured on "global" level and on per-server level. "Global" configuration is convenient in single- or multi-node environment if all your Zimbra MTA servers should use the same relay. Per-server configuration can be used in multi-node environment if each of your Zimbra MTA servers has to send email through a separate relay.

Note: that only non-local mail will be routed through a relay.

Other wiki articles

  • Outgoing SMTP Authentication - describes how to send mail through relay that requires authentication
  • Split Domain - describes split domain configuration
  • zmprov - explains how to use zmprov command line utility to change configuraiton attributes
  • zmsoap - explains how to use zmsoap command line utility to send SOAP requests to Zimbra server

configuring external relay MTA

zimbraMtaRelayHost

Host names for external relay MTAs are stored in Zimbra LDAP in zimbraMtaRelayHost attribute of global configuration and server objects. Values set for server objects take precedence over global configuration settings. If zimbraMtaRelayHost is set in global configuration and not set per server, all servers will use the value which is set in global configuration. The format of zimbraMtaRelayHost values is hostname + port number. It is a multi-value attribute and hence can contain more then one host name/port number combinations. You can also use IP address instead of hostname for zimbraMtaRelayHost. zimbraMtaRelayHost gets translated into postfix relayhost configuration. Postfix will use multiple relay hosts in the order provided, if any hosts return connection refused or timeout the next host in the list is attempted.

Note: zimbraMtaDnsLookupEnabled should be set to false when configuring a zimbraMtaRelayHost. If hostname.domain.tld is provided and DNS lookups are enabled, postfix will attempt to locate an MX record for that provided hostname. zimbraMtaRelayHost can be specified as [hostname.domain.tld] in which case the MX lookups are disabled regardless of the value of zimbraMtaDnsLookupEnabled.

setting zimbraMtaRelayHost via zmprov

  • per server:
zmprov ms server.domain.com zimbraMtaRelayHost external.relay.com:####
  • in global config:
zmprov mcf zimbraMtaRelayHost external.relay.com:####

setting zimbraMtaRelayHost via SOAP

  • Use ModifyServerRequest to change zimbraMtaRelayHost attribute of a server:
<ModifyServerRequest>
  <id>{value-of-zimbraId}</id>
  <a n="...">...</a>+
</ModifyServerRequest>

<ModifyServerResponse>
  <server name="{name}" id="{id}">
    <a n="...">...</a>+
  </server>
</ModifyServerResponse>
  • single relay host per server example:
<ModifyServerRequest>
  <id>8753b9e2-d4d4-430c-8130-492a03240864</id>
  <a n="zimbraMtaRelayHost">external.relay.com:25</a>
</ModifyServerRequest>
  • via zmsoap
zmsoap -z ModifyServerRequest/id="b4b24501-119a-4cc7-8159-2c85db31aad3" ../a=external.relay.com:1234 @n="zimbraMtaRelayHost" -v
  • multiple relay hosts per server example:
<ModifyServerRequest>
  <id>8753b9e2-d4d4-430c-8130-492a03240864</id>
  <a n="zimbraMtaRelayHost">external1.relay.com:25</a>
  <a n="zimbraMtaRelayHost">external2.relay.com:25</a>
</ModifyServerRequest>
  • via zmsoap
zmsoap -z ModifyServerRequest/id="b4b24501-119a-4cc7-8159-2c85db31aad3" ../a=external1.relay.com:1234 @n="zimbraMtaRelayHost"  ../a=external2.relay.com:1234 @n="zimbraMtaRelayHost" -v
  • Use ModifyConfigRequest to change zimbraMtaRelayHost attribute in global configuration:
<ModifyConfigRequest>
  <a n="...">...</a>+
</ModifyConfigRequest>

<ModifyConfigResponse/>
  • single relay host example:
<ModifyConfigRequest>
  <a n="zimbraMtaRelayHost">external.relay.com:25</a>
</ModifyConfigRequest>
  • via zmsoap
zmsoap -z ModifyConfigRequest/a=external.relay.com:1234 @n="zimbraMtaRelayHost" -v
  • multiple relay hosts example:
<ModifyConfigRequest>
  <a n="zimbraMtaRelayHost">external1.relay.com:25</a>
  <a n="zimbraMtaRelayHost">external2.relay.com:25</a>
</ModifyConfigRequest>
  • via zmsoap
zmsoap -z ModifyConfigRequest/a=external.relay.com:1234 @n="zimbraMtaRelayHost" ../a=external2.relay.com:1234 @n="zimbraMtaRelayHost" -v

setting zimbraMtaRelayHost in Zimbra Administration UI

Global Settings

Click on Global Settings in the navigation tree and open ""MTA"" tab:

GlobalConfigMTA.png

Type relay MTA host name and port number into the text fields next to ""Relat MTA for external delivery"" field. To add more external relays click ""Add"" button.

Server Settings

Select the server in the navigation tree or click on ""Servers"" in the navigation tree and select the server in the table

ServerMTATab.png

Type relay MTA host name and port number into the text fields next to ""Relat MTA for external delivery"" field. To add more external relays click ""Add"" button.

Jump to: navigation, search