Knowledgebase: Dedicated Server Guide
Change mail server main shared ip on cpanel server
Posted by PremiumReseller.com on 01 March 2009 12:54 AM

Sometimes your email server ip is blacklisted by some RBLs and you start getting complaints that emails are rejected.

It usually takes a few days to get the ip removed from RBL blacklist.

A simple solution to get around the problem is changing mailserver ip to a different clean ip on the server.

On server using Cpanel, you can edit file /etc/mailips.

Add this configuration line to tell Exim send email from new IP for all domains

*: new-mail-server-IP

On server without Cpanel, you can edit exim configuration file.

1. Login SSH to edit exim configuration: pico /etc/exim.conf

2. Search for "interface = ${if exists" or go to "remote_smtp" section under "TRANSPORTS CONFIGURATION"

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

3. Comment out # interface  and # helo_data

4. Add new line to specify outgoing mail server ip

interface = 123.123.123.123 # New ip address

5. Save exim configuration and restart exim

Exim will start sending out email from the new ip.

Please make sure that you disable cpanel update when using custom configuration or set exim.conf read only to avoid the configuration reset to default.

You will need to set reverse dns for the new ip and update A record.

After configuring mail server shared IP, send test email and check email header to verify update takes effect.

(255 vote(s))
This article was helpful
This article was not helpful