How to change Exim Sending IP

Changing Exim Sending IP

For start with second method it needs to turn on “Mail Server IP change feature of cPanel“. This can be done through “Exim Configuration Editor”.

i.e. Main >> Service Configuration >> Exim Configuration Editor

The “Domains and IPs” section of ”Exim Configuration Editor” has a line as following:

** 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) [?]
Ticking the check box along above stated line will enable that feature.

Or, in /etc/exim.conf.localopts, add/change this line:

After editing /etc/exim.conf.localopts run the script “buildeximconf” in “/script” and restart exim server.

i.e. /scripts/buildeximconf; /etc/init.d/exim restart

After this initial step of second method you need to make use of /etc/mailips file to proceed further with mail IP change.
For changing mail interface IP of the server globally, add the IP which want to set as mail IP to /etc/mailips in following given syntax:

where “” stands for the IP which want to set as mail IP in the server.

The second method also provide you a frendly feature to set mail IPs for each domain. For setting mail IP per domain wise, follow below given syntax: hostname.tld

where “” stands for the IP which want to set as domain mail IP and hostname.tld stands for the domain name.

If you have multiple dedicated IP domains already, I’ve devised a simple one liner using awk and sed to populate /etc/mailips automatically:

awk ‘{ print $2″: “$1 }’ /etc/domianips | sed ‘s/:$//’ >> /etc/mailips

Reference :

3 thoughts on “How to change Exim Sending IP

  1. I think this is one of the most significant info for me. And i am glad reading your article.
    But wanna remark on few general things, The site style is
    great, the articles is really excellent : D. Good job, cheers

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s