Applicable to:
- Plesk for Linux
Symptoms
-
Unable to receive email on the Plesk server, the process fails with the next error message in
/var/log/maillog
file:CONFIG_TEXT: (!)connect_to_sql: unable to connect to DSN 'DBI:mysql:database=emailsecurity;mysql_socket=/var/run/mysqld/mysqld.sock': Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")
(!!)TROUBLE in process_request: connect_to_sql: unable to connect to any dataset at (eval 146) line 253.
(!)Requesting process rundown after fatal error -
Plesk Email Security extension is installed
Cause
The issue is caused by Plesk Email Security bug with the ID #EXTPLESK-8784. Issue was fixed in Plesk Email Security 1.5.12
Resolution
Update Plesk Email Security extension to the latest version (1.5.12):
-
Navigate to Extensions > Updates menu
-
Press Check Now button, then select Plesk Email Security and press on Update button, like on screenshot below:
Workaround (if updating PES is not possible for some reason):
-
Log into the server via SSH.
-
Using the vi text editor open the /etc/amavisd/email-security.conf file
-
Find and change the value for the mysql_socket from below:
CONFIG_TEXT: mysql_socket=/var/run/mysqld/mysqld.sock
To the following:
CONFIG_TEXT: mysql_socket=/var/lib/mysql/mysql.sock
-
Save changes
-
Restart Amavisd service to apply the changes:
# systemctl restart amavisd.service
-
Execute the command below to force Postfix to deliver the emails from mail queue:
# postqueue -f
Comments
14 comments
It is working with your fix.
not working for me
Now it's working again!
Thank you !
On several Plesk servers (CentOS 7), in two config files (/etc/mail/local.cf and /etc/amavisd/email-security.conf) the following line was changed after the update:
["DBI:mysql:database=emailsecurity;host=localhost;port=3306", "username", "password"]
The lines where changed to use a socket connection, on my CentOS 7-servers, there is no such socket.
Restoring both files from the backups did solve the problem.
This update broke my spamassassin-filtering and no mail was accepted on my servers for several hours!
Luckily we have Backup MX-servers, no mail was lost. But it diminish my trust in this extension.
Glad this was fixed quickly but boy it caused a lot of customer grief today.
I have Centos 7 Plesk server and the onlyhave /etc/mail/spamassassin/local.cf. I did make the change on /etc/amavisd/email-security.conf and restored an earlier version of that local.cf with no joy.
Hello IT4BC,
What is the error in your maillog?
Can you state the two db-lines in those files?
work after uninstall Plesk Email Security extension
/usr/local/psa/admin/sbin/mailmng --restart-service
postsuper -r ALL
The fix above did not resolve the email issue.
Uninstalling Plesk Email Security allows NEW emails to be sent and received…
However we now hve 90+ emails in mail queue with error Deferred “4.3.2 deferred (host 127.0.0.1[127.0.0.1] said: 421 4.3.2 Service shutting down, closing channel (in reply to RCPT TO command))”
On Resend the error becomes: 4.3.0 deferred (mail transport unavailable)
If you reinstall this Extension the DB entry was set correct and send the mails in the mail queue:
@lookup_sql_dsn =(
["DBI:mysql:database=emailsecurity;host=localhost;port=3306"
Sorry but we think your workaround is wrong and many customers are waiting for a patch :-)
In our case the amavisd/email-security.conf was the problem.
typo, restart service all good..
The command line change did not fix it for us, but the extension update did fix it. Thank you.
Thanks to raoul delaboule
I uninstall and reinstall the extension and then execute the Raoul commands:
/usr/local/psa/admin/sbin/mailmng --restart-service
postsuper -r ALL
Works on some minutes, is not inmediate
Please sign in to leave a comment.