Sending mail through an external relay

Revision as of 21:59, 12 July 2015 by Jorge de la Cruz (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Sending mail through an external relay

   KB 3841        Last updated on 2015-07-12  

(0 votes)


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


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 the zimbraMtaRelayHost value is hostname + port number. You can also use IP address instead of hostname for zimbraMtaRelayHost. zimbraMtaRelayHost gets translated into postfix relayhost configuration. Postfix will use the relay host if any hosts return connection refused or timeout .

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. Notice the difference is the brackets - [hostname.domain.tld] . See for more details.

setting zimbraMtaRelayHost via zmprov

  • per server:
zmprov ms zimbraMtaRelayHost
  • in global config:
zmprov mcf zimbraMtaRelayHost

setting zimbraMtaRelayHost via SOAP

  • Use ModifyServerRequest to change zimbraMtaRelayHost attribute of a server:
  <a n="...">...</a>+

  <server name="{name}" id="{id}">
    <a n="...">...</a>+
  • Example:
  <a n="zimbraMtaRelayHost"></a>
  • via zmsoap
zmsoap -z ModifyServerRequest/id="b4b24501-119a-4cc7-8159-2c85db31aad3" ../ @n="zimbraMtaRelayHost" -v
  • Use ModifyConfigRequest to change zimbraMtaRelayHost attribute in global configuration:
  <a n="...">...</a>+

  • Example:
  <a n="zimbraMtaRelayHost"></a>
  • via zmsoap
zmsoap -z ModifyConfigRequest/ @n="zimbraMtaRelayHost" -v

setting zimbraMtaRelayHost in Zimbra Administration UI

Global Settings

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


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


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.

Verified Against: Date Created: 09/14/2010
Article ID: 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