Zimbra SMTP Relay through MailGun by Rackspace
scottalanmiller last edited by scottalanmiller
Setting up MailGun as an SMTP Relay for Zimbra is not entirely obvious. But it can be done and is not too hard. Assuming that you have a MailGun account already and you have made a username and password pair under your domain tab, we are ready to begin configuring Zimbra.
First, we need to be the zimbra user for all of this. If you try to do this as root, you will get errors that LMDB is not supported in CentOS 7 (and many other OS releases.) This is because you need to be using Zimbra's own version of the tools, not the OS ones.
su - zimbra
Now we can begin. First we set the relay host.
zmprov ms `zmhostname` zimbraMtaRelayHost smtp.mailgun.org
Now we need to set our password file.
echo smtp.mailgun.org [email protected]:your_password > /opt/zimbra/conf/relay_password
Now we need to process the map into an LMDB file.
We can test that this worked with this command.
postmap -q smtp.mailgun.org /opt/zimbra/conf/relay_password
Now to create the map from that file.
zmprov ms `zmhostname` zimbraMtaSmtpSaslPasswordMaps lmdb:/opt/zimbra/conf/relay_password
Now we override the outgoing server name.
zmprov ms `zmhostname` zimbraMtaSmtpCnameOverridesServername no
zmprov ms `zmhostname` zimbraMtaSmtpTlsSecurityLevel may
Zimbra will pick up these changes automatically within two minutes.
dafyre last edited by
We are using MailGun ourselves for delivery and it has been great.
wirestyle22 last edited by
@scottalanmiller Could you please advise how to remove those configuration if we change to IP based relay service?
Currently driving, but should be able to look at update relatively soon.