[Dovecot] Make user name CaSe Insensitive

John Wong johnw at wonghome.net
Thu Aug 17 13:08:06 EEST 2006


hi, i use dovecot-1.0rc6, and can not make user name case insensitive
when i login 'JOhwn' and 'johnw', dovecot will use two mail box

dovecot-sql.conf:
driver = mysql
connect = host=/mysql.sock dbname=mail user=UUUUUUUUUU password=XXXXXXXXXXX
default_pass_scheme = PLAIN-MD5
password_query = SELECT user as user, password FROM vuser WHERE user =
'%n' AND %Ls = '1' AND password != 'null'

mail log:
auth(default): client in: AUTH 1 PLAIN service=IMAP secured
lip=127.0.0.1 rip=127.0.0.1 resp=XXXXXXXXXX
Aug 17 17:46:03 tiny dovecot: auth-worker(default):
sql(JOhnw,127.0.0.1): query: SELECT user as user, password FROM vuser
WHERE user = 'JOhnw' AND imap = '1' AND password != 'null'
Aug 17 17:46:03 tiny dovecot: auth-worker(default):
auth(JOhnw,127.0.0.1): username changed JOhnw -> johnw
Aug 17 17:46:03 tiny dovecot: auth(default): client out: OK 1 user=JOhnw
Aug 17 17:46:03 tiny dovecot: auth(default): master in: REQUEST 798 32749 1
Aug 17 17:46:03 tiny dovecot: auth(default): master out: USER 798 JOhnw
uid=32765 gid=32765 home=/var/spool/postfix/var/./mail
Aug 17 17:46:03 tiny dovecot: imap-login: Login: user=<JOhnw>,
method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
Aug 17 17:46:05 tiny dovecot: IMAP(JOhnw): Disconnected: Logged out

mysql-shell:
mysql> use mail;
Database changed
mysql> select user as user, password from vuser where user = 'JOHnw' and
imap = '1' and password != 'null';
+-------+----------------------------------+
| user | password |
+-------+----------------------------------+
| johnw | XXXXXX this is md5 password XXXX |
+-------+----------------------------------+
1 row in set (0.02 sec)


Timo Sirainen wrote:
> On 7.8.2006, at 23.45, FlashWebHost.com wrote:
>
>>> password_query = select user, password, ..
>>> ie. make it return the "user" field as in the database.
>>
>> I have tried this.
>>
>> password_query = SELECT username as user, password FROM mailbox WHERE
>> username = '%u' AND active=1
>>
>> But it do not make the user name case insensitive. I can login with
>> CAPITAL and small letter user names and getting two different inboxes.
>
> Well, that should have worked. What Dovecot version are you using?
> Probably won't work with 0.99, but should work with 1.0rcs. Or what do
> you use as user_query? Maybe try enabling auth_debug and see what it
> shows.
>



More information about the dovecot mailing list