[Dovecot] Unknown column username in where clause

Daniel Luttermann daniel at dlutt.de
Tue Jul 20 13:17:55 EEST 2010


Timo Sirainen wrote on 20.07.2010:

> On 19.7.2010, at 22.59, Daniel Luttermann wrote:

>> The queries uses only "userid" instead of "username" so I think if one
>> sql field were missing it should report that "userid" could not be
>> found because the query is "FROM users WHERE userid = '%u'".
>> 
>> I've not select "username" in any sql select so I wonder where does
>> this name come from.

> There's actually a default query.. Hmm. Maybe it should be made
> empty, since probably no one wants to use it.

hmm, I've nothing read about that - but it's OK because the examples
in the wiki creates tables with the field "username" instead of
"userid" which I've used so the default query should then match...

>> password_query = SELECT userid AS user, password, \
>>  home AS userdb_home, uid AS userdb_uid, gid AS userdb_gid, \
>>  concat('*:bytes=', quota_bytes) as userdb_quota_rule \
>>  FROM users WHERE userid = '%u'

> You must also have a user_query for LDA/LMTP.

OK, it seems to be working if I add this in dovecot-sql.conf.ext too:

  user_query = SELECT home, uid, gid, \
    concat('*:bytes=', quota_bytes) as quota_rule \
    FROM users WHERE userid = '%u'

--
Daniel



More information about the dovecot mailing list