Postmap Error: Access Denied for mailuser

I'm setting up a mailserver, following Linode's "Email with Postfix" instructions. When I get to the point of of testing whether my email alias is present in mysql-virtual-mailbox-maps.cf, I get this rather contradictory message:

postmap: warning: connect to mysql server 127.0.0.1: Access denied for user 'mailuser'@'localhost' (using password: YES)
postmap: fatal: table mysql:/etc/postfix/mysql-virtual-alias-maps.cf: query error: Success

Does this indicate success or failure? The access denied message points to 'mailuser'@'localhost'. Should 'mailuser' be replaced by something else (such as the actual username)?

Thanks for any help.

4 Replies

Any user name should be ok (including "mailuser") as long as the pair user/password created to access the mysql database and the pair user/password you tell postfix and dovecot to use in the config files are the same.

Hello,

Check your password for mailuser again in the the file /etc/postfix/mysql-virtual-alias-maps.cf

I have the same problem.
User and password are correct. In fact, I can access mysql>

Here is the cf file:

cat mysql-virtual-mailbox-domains.cf

user = mailuser
password = mypassword
hosts = 127.0.0.1
dbname = mailserver
query = SELECT 1 FROM virtual_domains WHERE name='%s'

if I change user = root, and password = rootpassword

then it works.

But… that is not right, right?

The MySQL administrator (called "root" in your example) IS NOT the same as the super-user account called "root".

If you want to disambiguate them, create a new MySQL user (say "dbadmin") with a different password and give "dbadmin" all the same PRIVILEGEs as the MySQL account "root". Then log in to MySQL as "dbadmin" and delete the MySQL account "root".

With respect to your issue with "mailuser", did you give "mailuser" the correct PRIVILEGE to read the "virtual_domains" table? You should try your query manually using the mysql(1) command shell.

-- sw

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct