atom feed7 messages in net.sourceforge.lists.courier-imap[Courier-imap] Courier MySQL authenti...
FromSent OnAttachments
Алексей ИнкинApr 21, 2007 9:05 am 
moussApr 21, 2007 2:44 pm 
Алексей ИнкинApr 21, 2007 8:30 pm 
moussApr 22, 2007 1:05 am 
Andy ShellamApr 22, 2007 2:41 am 
Алексей ИнкинApr 22, 2007 11:35 am 
Andy ShellamApr 22, 2007 12:09 pm 
Subject:[Courier-imap] Courier MySQL authentication does not work with sql-mode=ansi
From:Алексей Инкин (alex@gmail.com)
Date:Apr 21, 2007 9:05:28 am
List:net.sourceforge.lists.courier-imap

Hi everyone.

Just faced this problem. I use MySQL which is configured to work in ANSI mode. This is rather common configuration (mysqld runs with --sql-mode=ansi argument). It appears that Courier MySQL authentication module does not work in this mode. In ANSI mode strings are only allowed in single quotes ( ' ) not double one ( " ). Double quotes are only used to enclose column names that contain characters that are otherwise unallowed. And the module generates SQL queries with double quotes like the following:

Apr 21 17:23:53 torpeda authdaemond: SQL query: SELECT id, "", clear, uid, gid, home, "", "", name, "" FROM users WHERE id = "ai@site52.ru" Apr 21 17:23:53 torpeda authdaemond: mysql_query failed, reconnecting: Unknown column '' in 'field list' Apr 21 17:23:53 torpeda authdaemond: mysql_query failed second time, giving up: Unknown column '' in 'field list' Apr 21 17:23:53 torpeda authdaemond: authmysql: TEMPFAIL - no more modules will be tried

In order to fix this issue and to make the module work in both MySQL SQL modes all the queries that the module generates must be rewritten using single quotes. Guys, I hope this will be done for I like strict design in everything and I prefer strict SQL mode very much.