Symptoms
Emails are not sent/received from a Plesk server with Plesk Email Security installed. The following messages appear in /var/log/maillog
:
amavis[3486]: (03486-01) (!)connect_to_sql: unable to connect to DSN 'DBI:mysql:database=emailsecurity;host=127.0.0.1;port=3306': Access denied for user '<database_name>'@'127.0.0.1' (using password: YES)
amavis[3486]: (03486-01) (!!)TROUBLE in process_request: connect_to_sql: unable to connect to any dataset at (eval 132) line 253.
amavis[3486]: (03486-01) (!)Requesting process rundown after fatal error
Cause
Product issue:
-
#EXTCERT-3178 "Reverted the hostname in the Amavis configuration file to localhost and enabled httpd_can_network_connect_db policy for SELinux. If you still encounter database connection issues, then disable enforcing mode in SELinux."
Fixed in:- Plesk Email Security 1.1.9 09 November 2020 (Linux)
- Plesk Email Security 1.1.9 09 November 2020 (Linux)
Resolution
Workaround
If update is not possible for some reason you may try the following
workaround
Apply the following workaround:
-
Connect to the Plesk server via SSH.
-
Open the MySQL configuration file
my.cnf
in a text editor. In this example, we are using the vi editor:-
on CentOS/RHEL-based distributions:
# vi /etc/my.cnf
-
on Debian/Ubuntu-based distributions:
# vi /etc/mysql/my.cnf
-
-
Comment out the
skip_name_resolve
directive by placing a # (hash) character at the beginning of the line:skip_name_resolve
-
Save the changes and close the file.
-
Restart the MySQL service:
# service mariadb restart || service mysql restart
-
Resend emails from the mail queue:
# postsuper -r ALL