How to change the mail server IP for a blacklisted server(cPanel) -Exim

How to change the mail server IP for sending emails, if your server ip address is blacklisted in TOP-LEVEL email providers ?

Sometimes the emails that we have sent being rejected by top level email providers because of the server IP blacklisted. In this situation where we are not able to sent or our messages that we have already sent is reached to the spam folder of others, the first step is check your IP is in any Blacklist. Here is the link to check IP black list http://mxtoolbox.com/blacklists.aspx . If your server IP address is not in this listed blacklist then the issue related to any other not related to your server IP.

If it is in Blacklist, (I) You must to take necessary actions/steps to remove IP address from there. (II) Here we have an alternative method to use another IP address for your Mail server. Here I’m explaining how to use an alternative IP address for Mail servers in a WHM/cPanel based servers.

Step I:  Add new IP address to your server.

Via WHM : Home » IP Functions » Add a New IP Address

Step II: Add IP to Mail server

SSH to server
[[email protected]]# vi /etc/mailips (And add the new IP address as mentioned below: )
*: xxx.xxx.xxx.xxx
~
~
:wq

step III: Add a RDNS entry, It may help DC to find you

[[email protected]]# vi /etc/mail_reverse_dns
xxx.xxx.xxx.xxx: HOSTNAME
~
~
:wq

Step IV: (Not necessary)
Change file attribute of /etc/mailips

[[email protected]]# chattr +i /etc/mailips
[[email protected]]# lsattr /etc/mailips
----i-------- /etc/mailips

Step V:
Final step; Re-build exim config file to reflect the changes then restart Exim service.

[[email protected]]# /scripts/buildeximconf
[[email protected]]# service exim restart

Then login to WHM panel and follow the steps pasted below for using our new IP address to send emails

Login to WHM (https:IPAddress:2087) >> Home >> Service Configuration >> Exim Configuration Manager >> In Basic editor section select Domain and IP's >> turn on "Reference /etc/mailips for outgoing SMTP connections" section >> SAVE

Please refer the attached image for more details.

mailip

That’s it 🙂

 

Related Links:
Quick way to remove all emails from the mail queue – Exim command line option
How to count emails in mail queue with mail senders’ name – Exim command
Check spamming on server having EXIM

Arunlal Ashok

Linux Server Administrator. I'm dealing with Linux servers since 2012. I started this blog to share and discuss my ideas with the world. Check My Profile!! in uPwork (oDesk) and let me know if you need any assistance. Thanks!!

You may also like...

1 Response

  1. Ron G says:

    Hello Arun, Great Post! Actually we have followed the accurate steps and IPs has been successfully changed but with Yahoo it is still showing the same error:
    Error: “421 4.7.0 [TS01] Messages from x.x.x.x temporarily deferred due to user complaints – 4.16.55.1” when sending email to Yahoo

    What can we do in this case?

    Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *