Change Exim Outgoing Mail IP

By default, Exim will be using the main server IP to send mails. If the main server IP is listed in any spam databases, then we will not be able to send mails. To resolve this, we can alter the Exim mail server IP to any other IP. To change exim mail outgoing IP address follows the steps given below.

To change from Command line

Step 1 : Shutdown the exim service.
# service exim stop or /etc/init.d/exim stop

Step 2 : Edit your exim configuration file.
# vi /etc/exim.conf

Locate the Below line’s.
—————————————————————————————————————————-
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}}
—————————————————————————————————————————-
Change it to
—————————————————————————————————————————-
remote_smtp:
driver = smtp
interface = 12.12.12.12 # Your New IP address.
—————————————————————————————————————————-
Step 3: start Exim.

To change via WHM

Login to WHM
Click Exim Configuration Editor
Check the box next to:

“Send outgoing mail from the ip that matches the domain name in /etc/mailips                             (*: IP can be added to the file to change the main outgoing interface)”
Save Changes

In Back end :

Then edit the file /etc/mailips

vi /etc/mailips

and add:

*: newIP

*:12.12.12.12
—————————————————————————————————————————-

Step 1 : Shutdown the exim service.
# service exim stop or /etc/init.d/exim stop

Step 2 : Edit your exim configuration file.
# vi /etc/exim.conf

Locate the Below line’s.
—————————————————————————————————————————-
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}}
—————————————————————————————————————————-
Change it to
—————————————————————————————————————————-
remote_smtp:
driver = smtp
interface = 12.12.12.12 # Your New IP address.
—————————————————————————————————————————-
Step 3: Start Exim.