Symptoms
- Plesk Obsidian running on a Linux-based operating system
- Emails cannot be sent from any webmail interface, while the following error is displayed:
SMTP Error (): Connection to server failed.
- Errors that are similar to the following appear in /var/log/maillog:
postfix/error[1749476]: CD48F891D5CC1: to=<[email protected]>, relay=none, delay=91244, delays=91058/186/0/0, dsn=4.4.2, status=deferred (delivery temporarily suspended: conversation with 127.0.0.1[127.0.0.1] timed out while receiving the initial server greeting)
PHP Warning: stream_socket_client(): Unable to connect to ssl://localhost:465 (Connection refused) in /usr/share/psa-roundcube/vendor/pear/net_socket/Net/Socket.php on line 159
Cause
The amavisd (or amavis) mail filter and the postfix mail transfer agent (or only one of them) are stuck, which has most likely occurred when the server resources were exhausted for a brief period of time.
Resolution
To resolve the issue, you must restart these services in the appropriate order, which can be done by following these steps:
1. Log into your server via SSH
2. Restart the related services (in the given order) by executing the following commands:
# systemctl restart amavisd
OR (if amavisd does not exist)
# systemctl restart amavis
# systemctl restart postfix
3. Requeue all deferred emails for a new sending attempt by executing the following command:
# postsuper -r ALL