Forked from rmckeel/Configure Exim on cPanel to use Mailgun SMTP
Created
May 7, 2021 11:36
-
-
Save ravenstar/daa0dab6c5314da6bf4d42738bea7899 to your computer and use it in GitHub Desktop.
Method for redirecting all email on a Linux WHM server for one domain to Mailgun for reliable delivery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This allows you to route all email from a Linux WHM server using exim through the Mailgun service | |
# or other email service. This is very powerful because email from a server is typically untrusted | |
# and hard to get good email delivery. | |
# This is not tested on servers that host multiple domains, because Mailgun's service is specific | |
# to one domain. If you figure out multiple domains with Mailgun, write it in the comments or fork this! | |
# Log in to WHM, go to Exim Configuration Manager -> Advanced Editor tab then edit the following. | |
### NOTE! | |
# If setting hosts_require_auth and hosts_require_tls = smtp.mailgun.org, | |
# exim selectively authenticates. This is because Mailgun has a round-robin | |
# DNS service. exim thinks that it has already authenticated, but it winds up | |
# at a new IP address and doesn't authenticate. For more info: | |
# https://serverfault.com/questions/727198/exim-not-always-sending-auth-login-username-password | |
Section: AUTH | |
mailgun_login: | |
driver = plaintext | |
public_name = LOGIN | |
hide client_send = : smtp.user@mail.domain.com : password | |
Section: ROUTERSTART | |
mailgun: | |
driver = manualroute | |
domains = ! +local_domains | |
transport = mailgun_transport | |
route_list = "* smtp.mailgun.org::587 byname" | |
host_find_failed = defer | |
no_more | |
Section: TRANSPORTSTART | |
mailgun_transport: | |
driver = smtp | |
hosts = smtp.mailgun.org | |
hosts_require_auth = * | |
hosts_require_tls = * |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment