How to change outbound mail IP address for Postfix, if the primary IP address is blacklisted and mail is not going out?
It is hardcoded in the Plesk backend that the IP address for outgoing mail in the Postfix configuration file (
) will be the same as the interface IP to which Postfix is listening. For example:
203.0.113.2- unix - n n - - smtp -o smtp_bind_address=203.0.113.2 -o smtp_bind_address6= -o smtp_address_preference=ipv4
203.0.113.3- unix - n n - - smtp -o smtp_bind_address=203.0.113.3 -o smtp_bind_address6= -o smtp_address_preference=ipv4
For older Plesk versions, the following workaround is available:
/etc/postfix/master.cffile and replace smtp_bind_address=203.0.113.2 with smtp_bind_address=203.0.113.3 .
# service postfix restart
Note: the default settings in
will be restored after mail reconfiguration on any domain. Consider creating a scheduled task to replace
with a custom file. The script for the scheduled task would be:
/bin/grep 'smtp_bind_address=203.0.113.2' /etc/postfix/master.cf
if [ $? -ne 1 ]; then
/bin/sed -i 's/smtp_bind_address=203.0.113.2/smtp_bind_address=203.0.113.3/g' /etc/postfix/master.cf