• Hi, Pleskians! We are running a UX testing of our upcoming product intended for server management and monitoring.
    We would like to invite you to have a call with us and have some fun checking our prototype. The agenda is pretty simple - we bring new design and some scenarios that you need to walk through and succeed. We will be watching and taking insights for further development of the design.
    If you would like to participate, please use this link to book a meeting. We will sent the link to the clickable prototype at the meeting.
  • (Plesk for Windows):
    MySQL Connector/ODBC 3.51, 5.1, and 5.3 are no longer shipped with Plesk because they have reached end of life. MariaDB Connector/ODBC 64-bit 3.2.4 is now used instead.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

Question Plesk Email Security Pro - 421 4.3.2 Service shutting down, closing channel - Mails are stuck in the queue

mcac

New Pleskian
Server operating system version
Almalinux 8.10
Plesk version and microupdate number
18.0.68 #1
Hi, 2 independent Plesk servers are with the same issues at the same time today. Many mails are stuck in the queue. I found the article https://support.plesk.com/hc/en-us/...*MTc0MTg1MDIyOC4yMS4xLjE3NDE4NTAzNTIuMjEuMC4w so I deinstall and reinstall Plesk Email Security Pro. The issues resolved this. But it is very strange that 2 servers have the same problem at the same time. Did others have the same problem today? Perhaps certain spam that is circulating today is causing the problem.
 
Hi,

we observed filling mailqueues on Centos7 and Almalinux8 servers since the march 12th update of E-Mail Security.

Cause was a wrong path in the E-Mail Security Config, preventing Amavisd connecting to MariaDB:

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
TROUBLE in process_request: connect_to_sql: unable to connect to any dataset at (eval 146) line 253.


Setting the correct path to the .sock in /etc/amavisd/email-security.conf and restarting amavisd fixed it.

I also recommend to requeue the mails:
postsuper -r ALL
or
postqueue -f

edit: In one case the amavisd service was not even running and not enabled.
 
After uninstall and reinstall, the problem returns:

Code:
Mar 13 10:22:32 xxxx amavis[248377]: (248377-01) (!)connect_to_sql: unable to connect to DSN 'DBI:mysql:database=emailsecurity;mysql_socket=/var/run/mysqld/mysqld.sock': Can't connect to local server through socket '/var/run/mysqld/mysqld.sock' (2)
Mar 13 10:22:32 xxxx amavis[248377]: (248377-01) (!!)TROUBLE in process_request: connect_to_sql: unable to connect to any dataset at /usr/share/perl5/vendor_perl/Amavis/Out/SQL/Connection.pm line 255.
Mar 13 10:22:32 xxxx amavis[248377]: (248377-01) (!)Requesting process rundown after fatal error
 
The problem is that Amavis is searching for the wrong mysqls.sock.


Simply edit the socket in /etc/amavisd/email-security.conf and restart Amavisd.service.


Search for and replace /var/run/mysqld/mysqld.sock with your correct mysql.sock path (e.g., /var/lib/mysql/mysql.sock or any other path used on your system).
 
Thanks for this information. Right, in logs were many errors like "connect_to_sql: unable to connect to DSN 'DBI:mysql:database=emailsecurity;mysql_socket=/var/run/mysqld/mysqld.sock': Can't connect to local server through socket '/var/run/mysqld/mysqld.sock'".
After reinstall the Email Security Pro no logs like this happend.
After reinstall I also cannot find a row like "mysql_socket=/var/run/mysqld/mysqld.sock" in file /etc/amavisd/email-security.conf described in

So it seems reinstall is also a resolution for this issue.
 
Oh no, all blacklists and whitelists are deleted now. It is definitively not a good way to remove and reinstall the Plesk Security. We have Plesk backups of system but there is of course no function to restore this configurations. Have anybody an idea, how can I restore this? Thanks Plesk for the bug, thanks Plesk for the resolution. :rolleyes:
 
Like above described I removed and reinstalled the extension because of this bug and the resolution of Plesk-KB (in my fist post). Now all blacklists and whitelists from customers are lost.
Is there a chance to restore from a Plesk full backup all Black- and Whitelists from extension Plesk Email Security Pro? For several postboxes or for all postboxes? I had a look in the backup file but I don't find any dump for emailsecurity database or any other files with this blacklists. Or is there a backup of database on the server? Where? In /var/lib/psa/dumps (https://support.plesk.com/hc/en-us/articles/12376967822231) I can only find the psa dump. In /var/lib/mysql-backup/emailsecurity I found the ibd-files and frm-files for tables. But the files are old.
 
In my case these did nothing. I still have hundreds of mails stuck in deferred and some angsty clients although after the plesk update yesterday NEW email is being delivered to the inboxes. I have not tried reinstalling the extension as I don't want to lose the blacklists but if I have to bite the bullet so be it. It would be nice if the blacklist could be exported but a copy and paste then trim was easy enough.

Restarting the service
postsuper -r ALL
postqueue -f
 
I suspect you received the extension update. My server received the extension update the next day (we applied the patch on all servers as soon as we were made aware of the issue):
Code:
# plesk bin action-log --show | grep -i email-security
127.0.0.1 admin [2025-03-13 03:37:16.680] 'Upgrade extension' ('Extension Id': 'email-security' => 'email-security', 'Extension Name': 'Plesk Email Security' => 'Plesk Email Security', 'Extension Release': '4906' => '5211', 'Extension Version': '1.5.10' => '1.5.11')
127.0.0.1 admin [2025-03-14 03:22:53.360] 'Upgrade extension' ('Extension Id': 'email-security' => 'email-security', 'Extension Name': 'Plesk Email Security' => 'Plesk Email Security', 'Extension Release': '5211' => '5258', 'Extension Version': '1.5.11' => '1.5.12')

The spam settings, including per user Blocklist and Allowlist are stored in the emailsecurity database. If you restore that entire database you will restore the Email Security settings, including per user settings.
 
Yes I received both of the updates. Problem is I still have hundreds of deferred emails stuck. I have restarted, removed the email security extension, tried re-queuing then reinstalled extension requeue and force delivery but it just says 0 messages when there are hundreds.

Is anyone else having this issue or resolved it?

Thanks Plesk. You could at least give us a script or something.

I suspect you received the extension update. My server received the extension update the next day (we applied the patch on all servers as soon as we were made aware of the issue):
Code:
# plesk bin action-log --show | grep -i email-security
127.0.0.1 admin [2025-03-13 03:37:16.680] 'Upgrade extension' ('Extension Id': 'email-security' => 'email-security', 'Extension Name': 'Plesk Email Security' => 'Plesk Email Security', 'Extension Release': '4906' => '5211', 'Extension Version': '1.5.10' => '1.5.11')
127.0.0.1 admin [2025-03-14 03:22:53.360] 'Upgrade extension' ('Extension Id': 'email-security' => 'email-security', 'Extension Name': 'Plesk Email Security' => 'Plesk Email Security', 'Extension Release': '5211' => '5258', 'Extension Version': '1.5.11' => '1.5.12')

The spam settings, including per user Blocklist and Allowlist are stored in the emailsecurity database. If you restore that entire database you will restore the Email Security settings, including per user settings.
 
The spam settings, including per user Blocklist and Allowlist are stored in the emailsecurity database. If you restore that entire database you will restore the Email Security settings, including per user settings.
Of course, I cannot perform a full restore of the Plesk backup, because otherwise all customer files will also be restored to the previous state. I assumed that a full Plesk backup would also back up the plesksecurity database. I only want to restore the database. But where can I find the backup of this database? I have searched the Plesk backup and have not found anything so far.
 
Unfortunately, emailsecurity database is not part of Plesk daily backups. Plesk daily contains:
Bash:
 zgrep -i "^use" /var/lib/psa/dumps/mysql.daily.dump.0.gz
USE `psa`;
USE `mysql`;
USE `horde`;
USE `apsc`;
USE `roundcubemail`;
USE `phpmyadmin`;
USE `psa`;
USE `mysql`;
USE `horde`;
USE `apsc`;
USE `roundcubemail`;
USE `phpmyadmin`;
In our case, we take full VPS backups which also include the emailsecurity database.
 
Back
Top