This is not the point. The field names are OK, and everything worked fine once 
I disabled strict ANSI SQL mode for my MySQL server. The point is that the 
queries generated by the authentication module use double quotes to enclose 
strings like:

WHERE id = "[EMAIL PROTECTED]"

Which is not complied to SQL standard and does not work for MySQL 
configurations that respect the standard. Everything should be rewritten with 
single quotes like:

WHERE id = '[EMAIL PROTECTED]'

P.S. I use Courier 4.1.1 that comes with Debian Etch.

On Sunday 22 April 2007 01:44, mouss wrote:
> Алексей Инкин wrote:
> > 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 = "[EMAIL PROTECTED]" 
> > 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.
>
> can you show the output of
>
> # grep MYSQL_CRYPT_PWFIELD /path/to/authmysqlrc
>
> ?
>
>
> most of these fields are from your own configuration file.
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Courier-imap mailing list
> [email protected]
> Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-imap

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Courier-imap mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-imap

Reply via email to