[Sysadmins] cyrus-sasl2 pam mysql не аутентифицирует

JaMm =?iso-8859-1?q?myjamm_=CE=C1_gmail=2Ecom?=
Вт Фев 5 02:00:53 MSK 2008


В сообщении от Monday 04 February 2008 09:44:17 вы написали:
> Здравствуйте!
>
> В системе (altlinux server 4.0.1) установлены следующие пакеты
> cyrus-imapd-2.3.11-alt1
> MySQL-server-5.0.51-alt1
> cyrus-sasl2-2.1.22-alt2
> postfix-2.4.6-alt3
> Пользователи берутся из mysql.
> Привожу конфиги.
> ***************************************************************************
>********************* pam.d/imap
> #%PAM-1.0
> auth     include        system-auth
> account  include        system-auth
>
> auth sufficient pam_mysql.so user=mail passwd=pass  host=localhost db=mail
> table=accountuser usercolumn=username passwdcolumn=password crypt=0
> #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=pass host=localhost db=mail
> table=accountuser usercolumn=username passwdcolumn=password crypt=0
> #logtable=log logmsgcolumn=msg logusercolumn=user loghostcolumn=host
> logpidcolumn=pid logtimecolumn=time
>
> account  sufficient       pam_unix_acct.so
> ***************************************************************************
>********************** Таблицы в mysql созданы с помощью скриптов
> web-cyradm.
> ***************************************************************************
>********************* sysconfig/saslauthd
> OPTIONS="-a pam -n 0"
> ***************************************************************************
>********************* стартую
> mysqld --log=log.log
> service saslauthd start
> делаю
> # testsaslauthd -u test -p 123
> 0: NO "authentication failed"
> # testsaslauthd -u test на test -p 123
> 0: NO "authentication failed"
> # testsaslauthd -u cyrus -p pass
> 0: NO "authentication failed"
>
> # mysql -u mail -p
> Enter password:
> Welcome to the MySQL monitor.  Commands end with ; or \g.
> Your MySQL connection id is 4
> Server version: 5.0.51-log ALT Linux MySQL RPM
> mysql> use mail;
> Database changed
> mysql> select * from accountuser;
> +-----------+---------------+--------+-------------+
>
> | username  | password      | prefix | domain_name |
>
> +-----------+---------------+--------+-------------+
>
> | cyrus     | M.QD4KWNL1YNo |        |             |
> | test на test | 123           |        |             |
> | test      | 123           |        |             |
> | tst       |               |        |             |
>
> +-----------+---------------+--------+-------------+
>
> смотрим log mysql:
> mysqld, Version: 5.0.51-log (ALT Linux MySQL RPM). started with:
> Tcp port: 3306  Unix socket: mysql.sock
> Time                 Id Command    Argument
> 080202  3:25:36       1 Connect     mail на localhost on mail
>                       1 Init DB     mail
>                       1 Query       SELECT password FROM accountuser WHERE
> username = 'test'
> 080202  3:25:38       1 Quit
> 080202  3:25:50       2 Connect     mail на localhost on mail
>                       2 Init DB     mail
>                       2 Query       SELECT password FROM accountuser WHERE
> username = 'test на test'
> 080202  3:25:52       2 Quit
> 080202  3:26:41       3 Connect     mail на localhost on mail
>                       3 Init DB     mail
>                       3 Query       SELECT password FROM accountuser WHERE
> username = 'cyrus'
>                       3 Query       SELECT password FROM accountuser WHERE
> username = 'cyrus'
> 080202  3:26:43       3 Quit
> 080202  3:27:10       4 Connect     mail на localhost on
>                       4 Query       select @@version_comment limit 1
> 080202  3:27:16       4 Query       SELECT DATABASE()
>                       4 Init DB     mail
> 080202  3:27:25       4 Query       select * from accountuser
> 080202  3:29:05       4 Quit
>
> смотрим messages
> Feb  2 03:25:38 smtp saslauthd[30876]: do_auth         : auth failure:
> [user=test] [service=imap] [realm=] [mech=pam] [reason=PAM auth error]
> Feb  2 03:25:52 smtp saslauthd[30881]: do_auth         : auth failure:
> [user=test на test] [service=imap] [realm=] [mech=pam] [reason=PAM auth error]
> Feb  2 03:26:43 smtp saslauthd[30886]: do_auth         : auth failure:
> [user=cyrus] [service=imap] [realm=] [mech=pam] [reason=PAM auth error]
>
>
> то есть pam mysql запрос к базе выполняет, но почему то аутентификация не
> проходит? все возможные how -to + /usr/doc + форумы и листы рассылки
> прочитал... Прошу помочь разобраться.

Никак не могу найти решения... Пытался сделать с AUXPROP - результат тот же, 
только запрос к sql даже не производится. Не знаю.. уже всё перепробовал. 
Может надо переходить на другую почтовую систему? 

-- 
С уважением, Андрей Степнов,
администратор сахалинского сегмента корпоративной сети ДВО РАН


Подробная информация о списке рассылки Sysadmins