Change Mail Server IP

Sometimes your server’s IP address may get black listed by most of RBLs. In such situation a quick solution is to route the emails through a secondary IP address on the same server which is not black listed. There are two options to switch the mail server IP.

1. In Cpanel:

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

Then edit the file /etc/mailips
vi /etc/mailips

and add:

*: newIP

Restart exim


2. Through Shell

vi /etc/exim.conf

Locate remote_smtp

Change as per below:


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}}

interface = 111.222.333.444 # Change to your server IP address.

Save changes and exit.

Restart Exim



Posted in Cpanel, Issues, Mail
4 comments on “Change Mail Server IP
  1. Thanks!

    Be careful with the 2nd method though… Aren’t direct changes to exim.conf going to be overwritten with cPanel upgrades?


  2. I want know too, what i must do for settings in /etc/mailip not owerwiten.


  3. Seems like u fully understand quite a lot related to this specific issue and it
    shows throughout this article, named “Change Mail Server IP LinuxStuffs.
    com”. Thx -Kristina


  4. Gilbert says:

    I visit day-to-day some web pages and sites to read posts,
    except this webpage presents quality based articles.


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

Blog Stats
  • 129,441 hits

Get every new post delivered to your Inbox.

Join 211 other followers

%d bloggers like this: