Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Reroute emails in cPanel during IP blacklist  (Read 1585 times)

0 Members and 1 Guest are viewing this topic.

vyshakhv

  • Newbie
  • *
  • Posts: 28
  • Karma: +0/-0
Reroute emails in cPanel during IP blacklist
« on: February 17, 2018, 02:12:29 pm »
Exim allows you to change the default IP address used by the mail server so that you would be able to route all emails to a new secondary IP address.

Here are the step by step instructions for you to configure your exim mail server to use new IP address.

Step 1 : Shutdown the exim service.
Code: [Select]
service exim stop or /etc/init.d/exim stopStep 2 : Edit your exim configuration file.
Code: [Select]
vi /etc/exim.confStep 3: go to “remote_smtp” section under “TRANSPORTS CONFIGURATION”.
By default it would look like below:
Code: [Select]
Quote:
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}}
Step 4 : Remove or comment line containing “interface” and “helo_data” and add new “interface” to match with that of your new IP address. It should look like as follows:
Code: [Select]
Quote:
remote_smtp:
driver = smtp
interface = 12.12.12.12 # Your IP address.
Step 5 : Save your changes and exit out from your exim configuration file.

Note : Dont forget to set read only attributes on exim configuration file, so that it wont get reset to default automatically.

You can do it using following command:
Code: [Select]
chattr +aui /etc/exim.conf
Step 6 : start exim service on your server.
Code: [Select]
service exim restart or /etc/init.d/exim restart
Step 7 : Make sure to set reverse DNS for this new IP address to point a valid FQDN.

Step 8 : Try sending a test email and you will find that, it was sent using this new IP address configured under your exim configuration.

You can verify it by checking the header of new email under exim’s log file i.e /var/log/exim_mainlog