How to change mail interface IP address

*********Exim*************
Step 1 : Shutdown the exim service.

# service exim stop or /etc/init.d/exim stop

Step 2 : Edit your exim configuration file.


# vi /etc/exim.conf

Step 3: go to "remote_smtp" section under "TRANSPORTS CONFIGURATION".


By default it would look like below:


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:


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:


# chattr +aui /etc/exim.conf

Step 6 : start exim service on your server.


# service exim restart or /etc/init.d/exim restart


*********SendMail***********

1) change the line below in sendmail.cf

#O ClientPortOptions=Family=inet, Address=x.x.x.x
to
O ClientPortOptions=Family=inet, Address=<ip address you want>


3) restart sendmail

Comments

Post a Comment

Popular posts from this blog

SVN: File remains in conflict

HowTo: Enable extended logging for exim

12 tweakings for WHM/cPanel to speed up WordPress