Change Exim mail server IP address in cPanel server

In cPanel/WHM, Exim uses main server’s IP to send mails, it can be changed to any other available IP in the server using the following procedure.

We can also consider it as a temporary workaround to the blacklist problem due to spam issues, and as mentioned, it is a temporary solution, you have to make sure that you identify and stop the outgoing spam mails from the server, for a permanent resolution to the blacklist.

a) Get in to WHM
b) Search for Exim Configuration Editor
c) Check the box next to:
d) Send outgoing mail from the ip that matches the domain name in /etc/mailips
e) Now click on Save
f) Now login to server ssh with root
g) Edit the file /etc/mailips
h) Add *: ReplacewithnewIP
i) Restart the exim service on server , with service exim restart command
j) Now edit the exim configuration file with command vi /etc/exim.conf
k) Find the entry remote_smtp
l) You can see an entry shown as below

remote_smtp:driver = smtp interface = ${if exists {/etc/mailips}{${lookup{$sender_address_domain}lsearch{/etc/mailips}{$value}{}}}{}}
helo_data = ${if exists {/etc/mailhelo}{${lookup{$sender_address_domain}lsearch{/etc/mailhelo}{$value}{$primary_hostname}}}{$primary_ho stname}}

You have to change it to:

driver = smtp
interface = # Change to your server IP address.

m) you must click Save button to reflect the changes and then restart the exim service on the server.

Should you have any queries, contact our 24*7 technical support team.