Symptoms

To Change The Outbound Mail IP Address For Plesk Server Running Postfix As MTA.

It is hardcoded in the Parallels Plesk Panel (PP) backend that the IP address for outgoing mail in the Postfix configuration file (/etc/postfix/master.cf) is the same as the interface IP to which Postfix is listening. Here is an example of such configuration:

1.1.1.1- unix – n n – – smtp -o smtp_bind_address=1.1.1.1 -o smtp_bind_address6= -o smtp_address_preference=ipv4
2.2.2.2- unix – n n – – smtp -o smtp_bind_address=2.2.2.2 -o smtp_bind_address6= -o smtp_address_preference=ipv4

Workaround

Edit the /etc/postfix/master.cf file and replace smtp_bind_address=1.1.1.1 with smtp_bind_address=2.2.2.2.

Then restart Postfix.

Stop: /etc/init.d/postfix stop
Start: /etc/init.d/postfix start
Restart: /etc/init.d/postfix restart

 

To Change The Outbound Mail IP Address For Plesk Server Running QMail As MTA.

Resolution

The default IP for outgoing connections can be set using the “ip” utility. First, check how routing is configured on the server:

# /sbin/ip route
192.168.50.0/24 dev eth1 proto kernel scope link src 192.168.50.53
169.254.0.0/16 dev eth1 scope link

default via 192.168.50.254 dev eth1

If no “src” is listed in the “ip” output for the default route, the main IP on the interface is used for outgoing connections. You can change it using the following command:

# /sbin/ip route change default via 192.168.50.254 dev eth1 src 192.168.50.100

Now:

/sbin/ip route

192.168.50.0/24 dev eth1 proto kernel scope link src 192.168.50.53

169.254.0.0/16 dev eth1 scope link

default via 192.168.50.254 dev eth1 src 192.168.50.100

Note: Be careful. If you set the wrong IP as the source, you will lose the link to the server.

Additional Information ::

To preserve this result after reboot on SLES10, you must insert the following lines into the

/etc/sysconfig/network/if-up.d/staticroutefile:

/sbin/ip route change default via 192.168.50.254 dev eth1 src 192.168.50.100<
/sbin/ip route change 192.168.50.0/24 dev eth1 src 192.168.50.100