Zimbra SMTP Relay through MailGun by Rackspace
-
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.
postmap /opt/zimbra/conf/relay_password
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
Enable TLS
zmprov ms `zmhostname` zimbraMtaSmtpTlsSecurityLevel may
Zimbra will pick up these changes automatically within two minutes.
-
@scottalanmiller said in Zimbra SMTP Relay through MailGun by Rackspace:
postmap -q smtp.sendgrid.net /opt/zimbra/conf/relay_password
Shouldn't this be smtp.mailgun.org?
-
@dafyre said in Zimbra SMTP Relay through MailGun by Rackspace:
@scottalanmiller said in Zimbra SMTP Relay through MailGun by Rackspace:
postmap -q smtp.sendgrid.net /opt/zimbra/conf/relay_password
Shouldn't this be smtp.mailgun.org?
Thanks, fixed.
-
We are using MailGun ourselves for delivery and it has been great.
-
@scottalanmiller said in Zimbra SMTP Relay through MailGun by Rackspace:
This is because you need to be using Zimbra's own version of the tools, not the OS ones.
-
@scottalanmiller Could you please advise how to remove those configuration if we change to IP based relay service?
Many thanks,
Minh. -
Currently driving, but should be able to look at update relatively soon.