pam_mysql problem, with md5 passwords

Uno Engborg uno at webworks.se
Thu Jun 25 18:23:51 UTC 2009


Hi, I'm trying to use saslautd with pam_mysql to allow user to log in to
a cyrus-imap server.


If use I create users and passordes in mysql like this:

insert into accountuser(username, password) values ("username",
encrypt("userpassword"));

and add enter the line below into my  /etc/pam.d/imap file:

auth sufficient pam_mysql.so user=mail passwd=secret host=localhost
db=mail table=accountuser usercolumn=username passwdcolumn=password
crypt=1 

I can verify that everything works fine by doing:

testsaslauthd -u "username" -p "usernamepassword" -s imap
And it returns: 
0: OK "Success. 
as it should

This mean that my saslconfiguration should be OK, so far.


The problem is that I need the system crypt system to use md5 as
encryption algorithm, as I have existing users, that I want to import
into my new imapb server.


To do that I instead need to create new users and passwords with a salt
starting witn $1$ like this:

insert into accountuser(username, password) values ("username",
encrypt("userpassword","$1$st$"));

And change the /etc/pam.d/imap to:

auth sufficient pam_mysql.so user=mail passwd=secret host=localhost
db=mail table=accountuser usercolumn=username passwdcolumn=password
crypt=1  md5="true"

Now testsaslauth fails.
Any ideas, why this doesn't work?

Regards
Uno Engborg






More information about the fedora-list mailing list