Sometimes, maybe due to spamming, our mail interface IP may get blacklisted. After fixing the spamming issue, you need to change the mail interface IP address to function instantly. This article will show you how to change your Exim IP address in Linux.
Shut down the exim service.
/etc/init.d/exim stop
Edit your exim configuration file.
vi /etc/exim.conf
Go to the “remote_smtp” section under “TRANSPORTS CONFIGURATION”.
By default it would look like 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}}
Remove or comment line containing “interface” and “helo_data” and add a new “interface” to match with that of your new IP address. It should look as follows:
remote_smtp: driver = smtp interface = 12.12.12.12 # Your IP address.
Save your changes and exit out from your Exim configuration file.
Note: Don’t forget to set read-only attributes on the Exim configuration file so it won’t automatically reset to default. ( If it’s cPanel )
You can do it using the following command:
chattr +aui /etc/exim.conf
Start exim service on your server.
/etc/init.d/exim restart
That’s it!! So that’s how you change the Exim IP address.
Please note that just changing the Exim interface IP is not a solution for the spamming issue. It’s only a temporary solution, and this new IP will also get blacklisted if you don’t fix the actual issues. Someone can’t keep changing the IP forever. To find and resolve the spamming issue first and then change the Exim IP only if required. If you are having trouble findings what script and files are causing the spamming, run Linux Maldet and ClamAV scan, and these Antivirus, Malware scanners will help you find the scripts. If you need help installing and configuring these scanners, here is the link to install ClamAV, and here is the link to install Maldet.