How to implement Mandrill with Exim on cPanel

How to implement Mandrill with Exim on cPanel


Mandrill is a transactional email service run by MailChimp, comparable to SendGrid. It comes stock with a powerful API for fast implementation into applications for sending email reliably over SMTP, but it can also be used as a smart host for all of your server’s outgoing email.

The below instructions cover how to do this via command line. If you prefer WHM, simply go to WHM >> Exim Configuration Manager >> Advanced Editor and alter the sections indicated.

First, open up your /etc/exim.conf.local file in an editor and look for the @AUTH@ section.

Perform modification as following

driver = plaintext
public_name = LOGIN
hide client_send = : your@email : api_key

Note: If exim.conf.local doesn’t exist, then we have to create it.

The value of api_key is not your Mandrill account password – it’s your API key. You can find it in your account settings under “SMTP & API Credentials”

Also, replace your@email with your Mandrill account email address. If you already have something in the AUTH section, simply add this block of text below it.

Now look for the @PREROUTERS@ section, and modify it to look like this:

driver = manualroute
domains = ! +local_domains
ignore_target_hosts =
transport = auth_relay
route_list = *

The last modification should be to the @TRANSPORTSTART@ section:

driver = smtp
port = 587
hosts_require_auth = $host_address
hosts_require_tls = $host_address

Save this file. Now open /etc/exim.conf.localopts and add this statement:


If you’re using WHM, this is under Basic Editor >> Mail >> Smarthost Support.

Save the file, and apply the changes:


service exim restart

To test whether things are working, send an email out from your server, and look for it in /var/log/exim_mainlog. You should see something like this in your log entry:

2016-01-12 21:59:50 1WNbGg-0006ud-2d => to@email R=smart_route T=auth_relay [x.x.x.x] X=UNKNOWN:ECDHE-RSA-AES256-GCM-SHA384:256 A=auth_login C="250 2.0.0 Ok: queued as 3529E193E178"

If you have SPF records, have to add the hostname of the SMTP server to the record itself to allow the third-party mail server to send email on behalf of your domain. Mandrill will provide the hostname you should use under Settings -> Sending Domains, when you do an SPF test.
First release
Last update
0.00 star(s) 0 ratings