Symptoms
There are lots of undelivered outgoing emails on the Plesk server. It is not possible to send mail and messages get stuck in the mail queue.
The following errors are logged in
/var/log/maillog:postfix/smtp[715642]: connect to example.com[203.0.113.2]:587: Invalid argument
postfix/smtp[715642]: 8A0FA1D2090C: [email protected], relay=none, delay=470, delays=470/0.01/0.16/0, dsn=4.4.1, status=deferred (connect to example.com[203.0.113.2]:587:
Invalid argument)postfix/qmgr[14111]: warning: connect to transport private/203.0.113.2-: Connection refused
postfix/error[21724]: 0A1322CF16C: [email protected], relay=none, delay=0.07, delays=0.03/0.01/0/0.02, dsn=4.3.0, status=deferred (mail transport unavailable)
Cause
Postfix is misconfigured.
Resolution
Connect to the server via SSH.
If there are no custom settings in Postfix's configuration, execute plesk repair mail utility:
# plesk repair mail -y
If there are some custom settings and the issue should be resolved more accurately, verify the following:
Transport settings are set as below:
# postconf -n | grep -i transport
sender_dependent_default_transport_maps = hash:/var/spool/postfix/plesk/sdd_transport_maps
transport_maps = , hash:/var/spool/postfix/plesk/transport
virtual_transport = plesk_virtualTransport may be defined in
sender_dependent_default_transport_mapif Send from domain IP addresses option is set in Tools & Settings > Mail Server Settings:# postmap -s /var/spool/postfix/plesk/sdd_transport_maps
@example.com plesk-203.0.113.2-:
@example2.com plesk-203.0.113.3-:Note: 203.0.113.x should be replaced with the server's IP addresses.
If so, the entries from
sdd_transport_mapsare defined in the first column ofsmtp_bind_addressoption.smtp_bind_addressis an optional numerical network address that the Postfix SMTP client should bind to when making an IPv4 connection.# grep "smtp_bind_address" /etc/postfix/master.cf
plesk-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
plesk-203.0.113.3- unix - n n - - smtp -o smtp_bind_address=203.0.113.3 -o smtp_bind_address6= -o smtp_address_preference=ipv4To be able to connect, smtp_bind_address needs to be defined as mentioned in the mynetworks section and the binding name should be the same as defined in
sdd_transport_maps:# postconf mynetworks
mynetworks = 127.0.0.0/8 [::1]/128 203.0.113.2/32, 203.0.113.3/32Starting from Plesk 12, it should be empty:
# postconf mynetworks
mynetworks =unless there are white-listed IP addresses in Plesk > Tools & Settings > Mail Server Settings > White List tab. If so, they will be added to
mynetworkssection.Restart the service:
# service postfix restart