cPanel Mail Servers

Configure Mailgun on cPanel (Exim)

configure Mailgun
configure Mailgun

Configure Mailgun on cPanel (Exim)

Configure Mailgun on cPanel is quite a simple task. Mailgun is an email automation service provided by Rackspace. It offers a complete cloud-based email service for sending, receiving and tracking email sent through your websites and applications.

Mailgun features are available through an intuitive RESTful API or using traditional email protocols like SMTP. It will help you to avoid the situation of detecting your email as spam in main email service providers.

This post will help you to configure Mailgun on cPanel. You can simply do it using “Exim Configuration Manager” option available on WHM. Please go to WHM > Service Configuration > Exim Configuration Manager and open the “Advanced Editor” tab.

You need to edit following sections there:

Search for “Section: AUTH” and add the following.

driver = plaintext
public_name = LOGIN
hide client_send = : : Password

Change with your “Default SMTP Login” and Password with “Default Password

Then, search for “Section: PREROUTERS” and add the following code.

driver = manualroute
domains = ! +local_domains
transport = mailgun_transport
route_list = * byname

Lastly, search for “Section: TRANSPORTSTART” and add the following code.

hosts_try_auth =

Save the configuration and send a test email. You can find something with * in the email header. Also, please note that, as this is a server wide configuration, the emails of all users on the server will relay through Mailgun.

Rackspace Cloud customers can send 50,000 emails per month for free with Mailgun’s basic plan. Mailgun is capable of integrating with postfix service, sending email through SMTP.

That’s it! Please let us know if you have any questions.

If you like this post and wish to receive more articles from us, please like our FB page: Grepitout

Your suggestions and feedbacks will encourage us and help to improve further, please feel free to write your comments.

For more details on our services, please drop us an E-mail at


Click here to post a comment