Configuration of Exim for Mailgun
Many users found it difficult to configure Mailgun on their cPanel/WHM for sending and receiving emails. I’ll explain it in a few steps and its very easy. Mailgun features are available through an API or SMTP. It helps avoiding your mails going to spam folders.
To configure Mailgun on cPanel/WHM follow these simple steps:
- Login to your WHM account
- Go to Service Configuration
- Go to Exim Configuration Manager
- Now open the Advanced Editor tab
- Search for Section: AUTH and add the following lines
mailgun_login: driver = plaintext public_name = LOGIN hide client_send = : email@example.com : Password
replace firstname.lastname@example.org with your default SMTP login and password with your SMTP password.
- Search for Section: PREROUTERS and add the following lines
mailgun: driver = manualroute domains = ! +local_domains transport = mailgun_transport route_list = * smtp.mailgun.org byname
- Finally, search for Section: TRANSPORTSTART and add the following lines
mailgun_transport: driver=smtp hosts_try_auth = smtp.mailgun.org
Save the configuration and then try sending a test email to confirm delivery into inbox. You can sign up for the free account of Mailgun here.