which postfix configuration file is for connecting mysql
When sending or start Postfix, connection to mysql failed:
ep 4 07:11:15 debianhost postfix/trivial-rewrite[3310]: warning: connect to mysql server 127.0.0.1: Access denied for user 'mailuser'@'localhost' (using password: YES)
I think this is because the user name and password sent to mysql were not right.
The corresponding rows in mysql.user is correct, as login from shell is OK.
Can any one tell me which configuration file in postfix is to storing the login details and sql of connecting to mysql?
3 Replies
There's a few different configuration files that will need to be updated with the MySQL username, database name, and password. They're all located in /etc/postfix/ with names similar to:
/etc/postfix/mysql-virtual-*
We have a guide on configuring Postfix with Dovecot and MySQL that lists each one individually.
Those configuration files are already set according to the configuration guidelines ,such as /etc/postfix/mysql-virtual-email2email.cf and etc.
With respect to the variables for the "SQl" like:
user = mailuser
password = password
hosts = 127.0.0.1
dbname = mailserver
query = SELECT email FROM virtual_users WHERE email='%s'
They do not seem to be for initial DB connection.
I suspect there is a configuration file used for connecting DB is missing or not configured.
The following mysql log suggested request has been received:
3685 Connect mailuser@localhost as anonymous on mailserver
So, which configuration file used for connecting DB ? Are there any log for viewing the initial connection job of Postfix?
This page lists the configuration files for setting up Postfix
Roughly look over the files and the directives , they all donot seem to be related to the initial connection with mysql.