Postfix keeps saying wrong MySQL-Syntax

0

I have the following Postfix config-file to map an email to itself (All credentials are fictional):

user = db_mailuser
password = mailuser_password
hosts = 127.0.0.1
dbname = mailserver
query = SELCET email FROM virtual_users WHERE email='%s'

When I do (after restarting postfix):

postmap -q email@some.domain mysql:/etc/postfix/mysql-email2email.cf

Then Postfix forwards the following MySQL message:

postmap: warning: mysql query failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELCET email FROM virtual_users WHERE email='email@some.domain'' at line 1

But at this point I am really confused, because the syntax is okay. I can go to mysql an query:

mysql> SELECT email FROM virtual_users WHERE email='email@some.domain' 

And it says:

+-------------------------+
| email                   |
+-------------------------+
| email@some.domain       |
+-------------------------+
1 row in set (0.00 sec)

What the hack could be wrong with my Postfix configuration?

Thank you in advance...

fragwürdig

Posted 2016-05-28T08:01:16.290

Reputation: 167

Answers

0

If this is a true copy and paste, You spelled select wrong. Its select not SELCET

DOH!!! (Been there done that)

cybernard

Posted 2016-05-28T08:01:16.290

Reputation: 11 200

that is REALLY awkward... you are right....... – fragwürdig – 2016-05-28T18:54:20.407