[Dovecot] Case sensitive user names

Jeff Graves jeff at image-src.com
Wed May 12 00:23:49 EEST 2004


Hello list. This is my first post and I hope that I have something
useful for people. Using Fedora Core 1 with the stock dovecot-0.99.10
RPM I noticed that user names were case sensitive which was a problem
for me since I was attempting to set up winbind authentication which
meant that what dovecot thought the homedir was could change depending
upon the case the user typed in. Sendmail/procmail always changed the
username to lowercase so I needed a way to duplicate this behavior. At
any rate, I searched the archives and found Andrew's post from March:
http://www.dovecot.org/list/dovecot/2004-March/003067.html - using this
as a jumping point and I finally have case insensitive user names
(better yet, forced lower case usernames) working for plain-text
authentication (eg. dovecot.conf: auth = plain, auth_userdb = passwd,
auth_passdb = passwd). It has been tested only on the source RPM from
Redhat FC1 and I'm not a C programmer so I have no idea if it will work
with other authentication methods or newer versions of software. I've
rebuilt the RPMs (source and i386) if anyone's interested and here's the
patch for those not using RPMs (it's attached as well):

diff -ru dovecot-0.99.10/src/auth/mech-plain.c
dovecot-0.99.10.new/src/auth/mech-plain.c
--- dovecot-0.99.10/src/auth/mech-plain.c	2003-05-18
08:26:28.000000000 -0400
+++ dovecot-0.99.10.new/src/auth/mech-plain.c	2004-05-11
16:58:30.000000000 -0400
@@ -57,6 +57,7 @@
 						      authenid);
 		}
 
+		auth_request->user = str_lcase(auth_request->user);
 		if (!mech_is_valid_username(auth_request->user)) {
 			/* invalid username */
 			if (verbose) {

Thanks,

Jeff Graves, MCP
Customer Support Engineer
Image Source, Inc.
10 Mill Street
Bellingham, MA 02019

508.966.5200 - Phone
508.966.5170 - Fax
jeff at image-src.com - Email
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dovecot-0.99.10-auth-case.patch
Type: application/octet-stream
Size: 453 bytes
Desc: not available
URL: <http://dovecot.org/pipermail/dovecot/attachments/20040511/c49b87dc/attachment-0001.obj>


More information about the dovecot mailing list