Cyrus is unable to access mysql

Jean-Gabriel Duquesnoy jean-gabriel at duquesnoy.de
Sat Jul 15 08:29:49 EDT 2006


Am Samstag, 15. Juli 2006 12:40 schrieb Jean-Gabriel Duquesnoy:
Hi,

Finally I have found my mistake. The pam_mysql libraries were 
installed in the wrong path (/usr/lib/security instead 
of /lib/security). I have now correctd this and I am now one step 
further. In  the /var/log/messages I find the foolowing:
Jul 15 14:10:41 mail imap[7186]: accepted connection
Jul 15 14:10:44 mail imap[7186]: could not find auxprop plugin, was 
searching for '[all]'
Jul 15 14:10:44 mail imap[7186]: could not find auxprop plugin, was 
searching for '[all]'
Jul 15 14:10:44 mail saslauthd[4128]: pam_mysql - SELECT returned no 
result.
Jul 15 14:10:44 mail saslauthd[4128]: pam_unix_auth(imap:auth): 
authentication failure; logname= uid=0 euid=0 tty= ruser= rhost=  
user=root
Jul 15 14:10:46 mail saslauthd[4128]: DEBUG: auth_pam: 
pam_authenticate failed: Permission denied
Jul 15 14:10:46 mail saslauthd[4128]: do_auth         : auth failure: 
[user=root] [service=imap] [realm=] [mech=pam] [reason=PAM auth 
error]
Jul 15 14:10:46 mail imap[7186]: badlogin: mail.jgduke.dnsalias.com 
[192.168.0.5] plaintext root SASL(-13): authentication failure: 
checkpass failed
 
I have checked the imap file in /etc/pam.d and it is correctly setup:
#%PAM-1.0
#auth     include        common-auth
#account  include        common-account
#password include        common-password
#session  include        common-session

auth sufficient pam_mysql.so user=mail passwd=password host=127.0.0.1 
db=mail table=accountuser usercolumn=username passwdcolumn=password 
crypt=1 logtable=log logmsgcolumn=msg logusercolumn=user 
loghostcolumn=host logpidcolumn=pid logtimecolumn=time

auth sufficient pam_unix_auth.so

account required pam_mysql.so user=mail passwd=password host=127.0.0.1 
db=mail table=accountuser usercolumn=username passwdcolumn=password 
crypt=1 logtable=log logmsgcolumn=msg logusercolumn=user 
loghostcolumn=host logpidcolumn=pid logtimecolumn=time

account  sufficient       pam_unix_acct.so

I have also checked the database and the table accountuser exists and 
contains one line for each of the user I tried:
mail:/opt/lampp/bin # ./mysql -u mail -p mail
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10 to server version: 5.0.20

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> select * from accountuser;
+----------+---------------+--------+---------------------+
| username | password      | prefix | domain_name         |
+----------+---------------+--------+---------------------+
| cyrus    | L8hp7gANADE6UhXU |        |                     |
| duke     | f0dC8OIDYz4COdZ. | JGDUKE | mydomain.com |
| mesi     | 1c2v2zw1cEaqDLA6 | JGDUKE | mydomain.com |
+----------+---------------+--------+---------------------+
3 rows in set (0,01 sec)

I do not know what is wrong. Perhaps it is not accesing the right 
database or table. But where can I find the information what 
pam_mysql is sending as Select request and to which database?

I would appreciate any advise or hint on how to solve this issue.

Thanks and best regards,

Jean-Gabriel

> Hi, I have setup my system with Cyrus IMAP and MySQL, but when
> trying to test using imtest, I always get an error:
> Jul 14 23:03:44 mail master[13859]: about to exec
> /usr/lib/cyrus/bin/imapd
> Jul 14 23:03:44 mail imap[13859]: executed
> Jul 14 23:03:44 mail imap[13859]: sql_select option missing
> Jul 14 23:03:44 mail imap[13859]: auxpropfunc error no mechanism
> available
> Jul 14 23:03:44 mail imap[13859]: _sasl_plugin_load failed on
> sasl_auxprop_plug_init for plugin: sql
> Jul 14 23:03:45 mail imap[13859]: accepted connection
> Jul 14 23:04:05 mail imap[13859]: could not find auxprop plugin,
> was searching for '[all]'
> Jul 14 23:04:05 mail imap[13859]: could not find auxprop plugin,
> was searching for '[all]'
> Jul 14 23:04:05 mail saslauthd[4100]: PAM unable to
> dlopen(/lib/security/pam_mysql.so)
> Jul 14 23:04:05 mail saslauthd[4100]: PAM [error:
> /lib/security/pam_mysql.so: cannot open shared object file: No such
> file or directory]
> Jul 14 23:04:05 mail saslauthd[4100]: PAM adding faulty module:
> /lib/security/pam_mysql.so
> Jul 14 23:04:06 mail saslauthd[4100]: pam_unix_auth(imap:auth):
> authentication failure; logname= uid=0 euid=0 tty= ruser= rhost=
> user=username
> Jul 14 23:04:08 mail saslauthd[4100]: DEBUG: auth_pam:
> pam_authenticate failed: Permission denied
> Jul 14 23:04:08 mail saslauthd[4100]: do_auth : auth failure:
> [user=username] [service=imap] [realm=] [mech=pam] [reason=PAM auth
> error]
> Jul 14 23:04:08 mail imap[13859]: badlogin: mail.mydomain.com
> [192.168.0.5] plaintext username SASL(-13): authentication failure:
> checkpass failed
>
> I have checked everything and cannot find any explanation for this.
> web-cyradm is working perfectly and able to access the MySQL
> database without any problems. Am I missing anything in my
> settings. My imapd.conf looks like:
> postmaster: postmaster
> configdirectory: /var/lib/imap
> partition-default: /var/spool/imap
> sievedir: /var/lib/sieve
> admins: cyrus
> allowanonymouslogin: no
> allowplaintext: yes
> sasl_mech_list: PLAIN
> servername: mail.mydomain.com
> autocreatequota: 10000
> reject8bit: no
> quotawarn: 90
> timeout: 30
> poptimeout: 10
> dracinterval: 0
> drachost: 192.168.0.5
> sasl_pwcheck_method: saslauthd
> #sasl_pwcheck_method: auxprop
> lmtp_overquota_perm_failure: no
> lmtp_downcase_rcpt: yes
> sendmail: /usr/sbin/sendmail
> sieve_maxscriptsize: 32
> sieve_maxscripts: 5
> autocreateinboxfolders: INBOX | INBOX.Trash | INBOX.Sent |
> INBOX.Drafts autosubscribeinboxfolders: INBOX | INBOX.Trash |
> INBOX.Sent | INBOX.Drafts
> Any idea what is wrong with my settings? I am using:
> pam_mysql-0.7RC1
> mysql Ver 14.12 Distrib 5.0.18, for suse-linux (i686) using
> readline 5.1 Cyrus IMAP4 v2.2.12
> saslauthd 2.1.21 authentication mechanisms: getpwent kerberos5 pam
> rimap shadow ldap
>
> Perhaps incompatibilities between the components integrated.
> Any help would be appreciated.
> Best regards,
> -- Jean-Gabriel Duquesnoy

-- 
Jean-Gabriel Duquesnoy
Sauerbornstraße 4
D-61184 Karben
Mob: +49-172-3408344


More information about the Cyrus-sasl mailing list