Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm playing with postfix configuration for the first time. I'm trying to set up the postfix user authentication through MySQL (I use the standard configuration with postfixadmin, courier, etc.) The problem is that I'm not able to authenicate (even in thunderbird or squirremail web interface) or even send any mail from 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

etc/postfix/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′

Does anybody see any problem somewhere? I'm completely lost. .-/

Thanks Devdas, I've changed all MySQL queries to "query = ..." based and it seams that it works. On the other hand, I still can't login. If I try to login it simply logs:

Jan 30 13:55:48 envelon imapd: LOGIN FAILED, user=test@domain.de, ip=[::ffff:127.0.0.1]
Jan 30 13:55:53 envelon imapd: LOGOUT, ip=[::ffff:127.0.0.1], rcvd=52, sent=332

and

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

Maybe the problem will be with the password because if I look to the database the hash for same passwords are different. But I'm pretty sure that the postfixadmin and courier password setup are OK. Or I don't see any folders in /home/virtual which is the home folder for virtual user

If i try to send an email from postfixadmin it works fine!:-)

Any suggestions?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

The answer is in your MySQL query logs.

Also, the recommended way is to use query instead of table, select_field, where_field and additional_conditions.

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

I aliased domain to d to make it easier for you to know which is the table and which the column.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.