Plesk

Emails are not sent/received when Plesk Email Security is installed: Access denied for user ‘<database_name>’@’127.0.0.1’ (using password: YES) – Plesk

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:

Resolution

Please consider updating your server:

Workaround

If update is not possible for some reason you may try the following

workaround

Apply the following workaround:

  1. Connect to the Plesk server via SSH.

  2. 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

  3. Comment out the skip_name_resolve directive by placing a # (hash) character at the beginning of the line:

    skip_name_resolve

  4. Save the changes and close the file.

  5. Restart the MySQL service:

    # service mariadb restart || service mysql restart

  6. Resend emails from the mail queue:

    # postsuper -r ALL

Exit mobile version