后缀 – MySQLvalidation失败

我正在玩的第一次postfixconfiguration。 我试图设置通过MySQL的Postfix用户authentication(我使用postfixadmin,快递等标准configuration)问题是,我无法authentication(即使在雷鸟或squirremailnetworking界面),甚至发送来自postfixadmin的任何邮件。

/var/log/mail.err

Jan 30 12:30:29 envelon postfix/trivial-rewrite[29916]: fatal: proxy:mysql:/etc/postfix/mysql_relay_domains_maps.cf(0,lock|fold_fix): table lookup problem 

/var/log/mail.warn

 Jan 30 12:31:30 envelon postfix/proxymap[29783]: 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 '??1???' at line 1 Jan 30 12:31:30 envelon postfix/trivial-rewrite[29919]: fatal: proxy:mysql:/etc/postfix/mysql_relay_domains_maps.cf(0,lock|fold_fix): table lookup problem Jan 30 12:31:30 envelon postfix/trivial-rewrite[29920]: fatal: proxy:mysql:/etc/postfix/mysql_relay_domains_maps.cf(0,lock|fold_fix): table lookup problem Jan 30 12:31:31 envelon postfix/smtpd[29810]: warning: problem talking to service rewrite: Success Jan 30 12:31:31 envelon postfix/smtpd[29782]: warning: problem talking to service rewrite: Connection reset by peer Jan 30 12:31:31 envelon postfix/master[19619]: warning: process /usr/lib/postfix/trivial-rewrite pid 29919 exit status 1 Jan 30 12:31:31 envelon postfix/master[19619]: warning: /usr/lib/postfix/trivial-rewrite: bad command startup -- throttling Jan 30 12:31:31 envelon postfix/smtpd[29790]: warning: problem talking to service rewrite: Connection reset by peer Jan 30 12:31:31 envelon postfix/master[19619]: warning: process /usr/lib/postfix/trivial-rewrite pid 29920 exit status 1 

等/后缀/ mysql_relay_domains_maps.cf

 user = postfix password = XXXXXXXXXXX hosts = 127.0.0.1 dbname = postfix table = domain select_field = domain where_field = domain additional_conditions = and backupmx = ′1′ 

有人在任何地方看到任何问题吗? 我完全失去了。 .- /

谢谢Devdas,我已经改变了所有的MySQL查询为“查询= …”为基础,它接缝,它的工作。 另一方面,我仍然无法login。 如果我尝试login它只是日志:

 Jan 30 13:55:48 envelon imapd: LOGIN FAILED, [email protected], ip=[::ffff:127.0.0.1] Jan 30 13:55:53 envelon imapd: LOGOUT, ip=[::ffff:127.0.0.1], rcvd=52, sent=332 

 Jan 30 14:35:21 server postfix/trivial-rewrite[30680]: warning: table "mysql:/etc/postfix/mysql_virtual_domains_maps.cf": empty lookup result for: "domain.de" -- ignored 

也许问题将与密码,因为如果我看数据库相同的密码哈希是不同的。 但我很确定postfixadmin和快递密码设置是确定的。 或者我没有看到/ home / virtual中的任何文件夹,这是虚拟用户的主文件夹

如果我尝试从postfixadmin发送电子邮件,它工作正常!:-)

有什么build议么?

答案是在你的MySQL查询日志中。

此外,推荐的方法是使用查询而不是tableselect_fieldwhere_fieldadditional_conditions

 query = SELECT d.domain FROM domain AS d WHERE d.domain = '%s' AND backupmx = 1 

我将domain重名为d ,以便您更容易地知道哪个表和哪个列。