Home » WHM/cPanel » How to change exim mail outgoing IP address

How to change exim mail outgoing IP address

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. In sequence 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.
Configuring Exim from WHM
1) Login to WHM
2) WHM >> Main >> Service Configuration >> Exim Configuration Editor >> Domains and IPs , enable option “Reference /etc/mailips for outgoing SMTP connections /etc/mailips”
3) Save Changes
Then edit the file /etc/mailips

from shell and add: *: ReplacewithnewIP
#service exim restart

##############################
2) Configuring Exim from SHELL
Login to Shell
Open the Exim configuration file in your favorite editor

#vi /etc/exim.conf

.Search “remote_smtp” under Transport Configuration”.
By default it would look as below

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

Comment line containing “interface” and “helo_data” and add new “interface” with new ip address

remote_smtp:
driver = smtp
interface = 192.168.0.1

You need to alternate the right IP address here.
Restart Exim using the following commands

#service exim restart

This will change the outgoing mail server IP of the exim mail server.

Note : Please remember to set read only attributes on exim configuration file, so that it won’t get reset to default automatically.

You can do it using following command:

# chattr +aui /etc/exim.conf

About

I am founder and webmaster of www.linuxpcfix.com and working as a Sr. Linux Administrator (Expertise on Linux/Unix & Cloud Server) and have been in the industry from last 7 years.

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*

Time limit is exhausted. Please reload the CAPTCHA.

Categorized Tag Cloud