Use Mandrill with Exim on cPanel/WHM to Solve SPAM email Issue

If you are using phpmail or sendmail function in your website, you may notice that, some of the email may end up in SPAM folder of the intended recipients. The situation become worsen if the intended recipients are using hotmail/livemail/outlook, which has stricter filtering. The recipient may not receive the email at all. Not even in Junk folder.

This is a big issue if you are running an e-commerce and even bigger issue for newsletter/mailing list website like Interspire Email Marketer.

To solve this issue, we can use transactional email or bulk email service such as Mandrill with Exim on cPanel/WHM server.

To integrate Mandrill with Exim on cPanel/WHM, we have to add proper settings as below.

 

1. Login to WHM with a root access & browse to

WHM → Service Configuration → Exim Configuration Manager → Basic Editor

 

2. In “Mail → Smarthost support”, add the following

*: smtp.mandrillapp.com

 

3. Browse to

WHM → Service Configuration → Exim Configuration Manager → Advanced Editor

 

4. Search for – “Section: AUTH” & add the following code. Change youremail@yourdomain : api-key with your email & Mandrill API Key

auth_login:
driver = plaintext
public_name = LOGIN
hide client_send = : youremail@yourdomain : api-key

 

5. Search for – “Section: PREROUTERS” & add the following code.

smart_route:
driver = manualroute
domains = ! +local_domains
ignore_target_hosts = 127.0.0.0/8
transport = auth_relay
route_list = * smtp.mandrillapp.com
no_more

 

6. Search for – “Section: TRANSPORTSTART” & add the following code.

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

 

7. Save the new configuration.

8. Send a test email & you should see the email header should have something with *mandrill.com


Remove Category-Location at Sitemap & Listing of phpMyDirectory

phpMyDirectory (PMD) is a great directory software. You can browse listings via Category, Location or Category-Location. However, for some directory, it is not necessary to have category-location as many of them do not contain any listing. This may give poor SEO.

If your directory falls under this category, you may want to disable Category-Location in the Sitemap & Listing Page. To disable there are 3 files that you need to modify.

1. /xml.php

Find this code

if($categories_count > 0 AND $locations_count > 0) {

Replace it with

if($categories_count > 0 AND $locations_count > 0 AND FALSE) {

 

2. browse_categories.tpl – in template directory

Find this code

<?php if($location_columns) { ?>

Replace it with

<?php if($location_columns AND FALSE) { ?>

 

3. browse_location.tpl – in template directory

Find this code

<?php if($category_columns) { ?>

Replace it with

<?php if($category_columns AND FALSE) { ?>