LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 2732|回复: 1

pam_mysql认证日志出错,不知何故

[复制链接]
发表于 2008-3-20 15:38:35 | 显示全部楼层 |阅读模式
我在做sendmail sasl 通过pam_mysql认证时候出现的问题。

系统环境

sendmail
dovecot--pop3--直接通过dovecot数据库认证功能实现mysql认证
smtp -sasl -pam -pam_mysql 认证
间接通过sasl的pam认证机制从而调用pam_mysql实现mysql数据库认证



本人这个邮件系统现在情况:



系统用户收发邮件都正常

唯独给非系统用户无法发送邮件,邮件日志提示:user unknow

但是非系统用户对本地用户和英特网用户发送邮件正常



请问:
1.pam_mysql - pam_mysql_check_passwd() returning 6.
这个返回值6代表什么意思?

2.
pam_mysql - INSERT INTO logtable (message_column, user_column, host_column, rhost_column, pid_column, time_column) VALUES ('AUTHENTICATION FALURE (FIRST_PASS)', 'xt', '192.168.1.230', '(unknown)', '4281', NOW())

这个能说明什么问题呢?

这个'AUTHENTICATION FALURE (FIRST_PASS)中的falure是不是failure的误写?

是不是以上俩个错误导致sendmail非系统用户无法收信问题呢?请赐教

pam_mysql日志如下



Mar 20 07:29:26 xt saslauthd[4281]: pam_mysql - option verbose is set to "1"
Mar 20 07:29:26 xt saslauthd[4281]: pam_mysql - option user is set to "root"
Mar 20 07:29:26 xt saslauthd[4281]: pam_mysql - option passwd is set to "123456"
Mar 20 07:29:26 xt saslauthd[4281]: pam_mysql - option host is set to "localhost"
Mar 20 07:29:26 xt saslauthd[4281]: pam_mysql - option db is set to "sendmail"
Mar 20 07:29:26 xt saslauthd[4281]: pam_mysql - option table is set to "users"
Mar 20 07:29:26 xt saslauthd[4281]: pam_mysql - option usercolumn is set to "userid"
Mar 20 07:29:26 xt saslauthd[4281]: pam_mysql - option passwdcolumn is set to "password"
Mar 20 07:29:26 xt saslauthd[4281]: pam_mysql - option crypt is set to "0"
Mar 20 07:29:26 xt saslauthd[4281]: pam_mysql - option logtable is set to "logtable"
Mar 20 07:29:26 xt saslauthd[4281]: pam_mysql - option logmsgcolumn is set to "message_column"
Mar 20 07:29:26 xt saslauthd[4281]: pam_mysql - option logusercolumn is set to "user_column"
Mar 20 07:29:26 xt saslauthd[4281]: pam_mysql - option logpidcolumn is set to "pid_column"
Mar 20 07:29:26 xt saslauthd[4281]: pam_mysql - option loghostcolumn is set to "host_column"
Mar 20 07:29:26 xt saslauthd[4281]: pam_mysql - option logrhostcolumn is set to "rhost_column"
Mar 20 07:29:26 xt saslauthd[4281]: pam_mysql - option logtimecolumn is set to "time_column"
Mar 20 07:29:26 xt saslauthd[4281]: pam_mysql - option sqllog is set to "true"
Mar 20 07:29:26 xt saslauthd[4281]: pam_mysql - pam_mysql_close_db() called.
Mar 20 07:29:26 xt saslauthd[4281]: pam_mysql - pam_sm_authenticate() called.
Mar 20 07:29:26 xt saslauthd[4281]: pam_mysql - pam_mysql_open_db() called.
Mar 20 07:29:26 xt saslauthd[4281]: pam_mysql - pam_mysql_open_db() returning 0.
Mar 20 07:29:26 xt saslauthd[4281]: pam_mysql - pam_mysql_check_passwd() called.
Mar 20 07:29:26 xt saslauthd[4281]: pam_mysql - pam_mysql_format_string() called
Mar 20 07:29:26 xt saslauthd[4281]: pam_mysql - pam_mysql_quick_escape() called.
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - SELECT password FROM users WHERE userid = 'xt'
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - pam_mysql_check_passwd() returning 6.
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - pam_mysql_sql_log() called.
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - pam_mysql_format_string() called
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - pam_mysql_quick_escape() called.
Mar 20 07:29:27 xt last message repeated 3 times
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - INSERT INTO logtable (message_column, user_column, host_column, rhost_column, pid_column, time_column) VALUES ('AUTHENTICATION FALURE (FIRST_PASS)', 'xt', '192.168.1.230', '(unknown)', '4281', NOW())
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - pam_mysql_sql_log() returning 0.
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - pam_mysql_converse() called.
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - pam_mysql_open_db() called.
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - pam_mysql_check_passwd() called.
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - pam_mysql_format_string() called
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - pam_mysql_quick_escape() called.
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - SELECT password FROM users WHERE userid = 'xt'
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - pam_mysql_check_passwd() returning 0.
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - pam_mysql_sql_log() called.
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - pam_mysql_format_string() called
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - pam_mysql_quick_escape() called.
Mar 20 07:29:27 xt last message repeated 3 times
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - INSERT INTO logtable (message_column, user_column, host_column, rhost_column, pid_column, time_column) VALUES ('AUTHENTICATION SUCCESS', 'xt', '192.168.1.230', '(unknown)', '4281', NOW())
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - pam_mysql_sql_log() returning 0.
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - pam_sm_authenticate() returning 0.
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - option verbose is set to "1"
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - option user is set to "root"
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - option passwd is set to "123456"
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - option host is set to "localhost"
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - option db is set to "sendmail"
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - option table is set to "users"
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - option usercolumn is set to "userid"
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - option passwdcolumn is set to "password"
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - option crypt is set to "0"
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - option logtable is set to "logtable"
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - option logmsgcolumn is set to "message_column"
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - option logusercolumn is set to "user_column"
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - option logpidcolumn is set to "pid_column"
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - option loghostcolumn is set to "host_column"
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - option logrhostcolumn is set to "rhost_column"
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - option logtimecolumn is set to "time_column"
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - option sqllog is set to "true"
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - pam_mysql_close_db() called.
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - pam_sm_acct_mgmt() called.
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - pam_mysql_open_db() called.
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - pam_mysql_open_db() returning 0.
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - pam_mysql_query_user_stat() called.
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - pam_mysql_format_string() called
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - pam_mysql_quick_escape() called.
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - SELECT 0, password FROM users WHERE userid = 'xt'
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - pam_mysql_query_user_stat() returning 0.
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - pam_mysql_sql_log() called.
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - pam_mysql_format_string() called
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - pam_mysql_quick_escape() called.
Mar 20 07:29:27 xt last message repeated 3 times
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - INSERT INTO logtable (message_column, user_column, host_column, rhost_column, pid_column, time_column) VALUES ('QUERYING SUCCESS', 'xt', '192.168.1.230', '(unknown)', '4281', NOW())
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - pam_mysql_sql_log() returning 0.
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - pam_sm_acct_mgmt() returning 0.
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - pam_mysql_release_ctx() called.
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - pam_mysql_destroy_ctx() called.
Mar 20 07:29:27 xt saslauthd[4281]: pam_mysql - pam_mysql_close_db() called.
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - option verbose is set to "1"
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - option user is set to "root"
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - option passwd is set to "123456"
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - option host is set to "localhost"
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - option db is set to "sendmail"
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - option table is set to "users"
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - option usercolumn is set to "userid"
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - option passwdcolumn is set to "password"
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - option crypt is set to "0"
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - option logtable is set to "logtable"
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - option logmsgcolumn is set to "message_column"
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - option logusercolumn is set to "user_column"
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - option logpidcolumn is set to "pid_column"
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - option loghostcolumn is set to "host_column"
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - option logrhostcolumn is set to "rhost_column"
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - option logtimecolumn is set to "time_column"
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - option sqllog is set to "true"
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - pam_mysql_close_db() called.
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - pam_sm_authenticate() called.
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - pam_mysql_open_db() called.
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - pam_mysql_open_db() returning 0.
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - pam_mysql_check_passwd() called.
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - pam_mysql_format_string() called
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - pam_mysql_quick_escape() called.
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - SELECT password FROM users WHERE userid = 'xt'
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - pam_mysql_check_passwd() returning 6.
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - pam_mysql_sql_log() called.
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - pam_mysql_format_string() called
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - pam_mysql_quick_escape() called.
Mar 20 07:46:37 xt last message repeated 3 times
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - INSERT INTO logtable (message_column, user_column, host_column, rhost_column, pid_column, time_column) VALUES ('AUTHENTICATION FALURE (FIRST_PASS)', 'xt', '192.168.1.230', '(unknown)', '21888', NOW())
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - pam_mysql_sql_log() returning 0.
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - pam_mysql_converse() called.
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - pam_mysql_open_db() called.
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - pam_mysql_check_passwd() called.
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - pam_mysql_format_string() called
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - pam_mysql_quick_escape() called.
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - SELECT password FROM users WHERE userid = 'xt'
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - pam_mysql_check_passwd() returning 0.
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - pam_mysql_sql_log() called.
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - pam_mysql_format_string() called
Mar 20 07:46:37 xt saslauthd[21888]: pam_mysql - pam_mysql_quick_escape() called.
Mar 20 07:46:38 xt last message repeated 3 times
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - INSERT INTO logtable (message_column, user_column, host_column, rhost_column, pid_column, time_column) VALUES ('AUTHENTICATION SUCCESS', 'xt', '192.168.1.230', '(unknown)', '21888', NOW())
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - pam_mysql_sql_log() returning 0.
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - pam_sm_authenticate() returning 0.
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - option verbose is set to "1"
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - option user is set to "root"
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - option passwd is set to "123456"
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - option host is set to "localhost"
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - option db is set to "sendmail"
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - option table is set to "users"
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - option usercolumn is set to "userid"
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - option passwdcolumn is set to "password"
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - option crypt is set to "0"
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - option logtable is set to "logtable"
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - option logmsgcolumn is set to "message_column"
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - option logusercolumn is set to "user_column"
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - option logpidcolumn is set to "pid_column"
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - option loghostcolumn is set to "host_column"
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - option logrhostcolumn is set to "rhost_column"
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - option logtimecolumn is set to "time_column"
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - option sqllog is set to "true"
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - pam_mysql_close_db() called.
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - pam_sm_acct_mgmt() called.
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - pam_mysql_open_db() called.
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - pam_mysql_open_db() returning 0.
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - pam_mysql_query_user_stat() called.
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - pam_mysql_format_string() called
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - pam_mysql_quick_escape() called.
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - SELECT 0, password FROM users WHERE userid = 'xt'
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - pam_mysql_query_user_stat() returning 0.
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - pam_mysql_sql_log() called.
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - pam_mysql_format_string() called
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - pam_mysql_quick_escape() called.
Mar 20 07:46:38 xt last message repeated 3 times
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - INSERT INTO logtable (message_column, user_column, host_column, rhost_column, pid_column, time_column) VALUES ('QUERYING SUCCESS', 'xt', '192.168.1.230', '(unknown)', '21888', NOW())
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - pam_mysql_sql_log() returning 0.
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - pam_sm_acct_mgmt() returning 0.
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - pam_mysql_release_ctx() called.
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - pam_mysql_destroy_ctx() called.
Mar 20 07:46:38 xt saslauthd[21888]: pam_mysql - pam_mysql_close_db() called.
 楼主| 发表于 2008-3-20 16:50:08 | 显示全部楼层
sendmail 正常发给系统用户和其他外网用户时和发给非系统本地用户,我比较了相关日志
比较pam_mysql日志:
发现日志更上面贴出来的是一样的。

然后在比较sendmail的日志,
不正常情况--给非系统用户发邮件时:
Mar 20 08:31:24 xt sendmail[22862]: m2K0VO8v022862: <xt@xt.xiutuo.com>... User unknown
Mar 20 08:31:24 xt sendmail[22862]: m2K0VO8v022862: from=<xt@xt.xiutuo.com>, size=0, class=0, nrcpts=0, proto=ESMTP, daemon=Daemon0, relay=[192.168.1.137]

正常情况--给系统用户和其他外网用户发送邮件时

Mar 20 08:22:27 xt sendmail[22479]: m2K0MOCe022475: to=<xiutuo@qq.com>, delay=00:00:01, xdelay=00:00:00, mailer=esmtp, pri=121129, relay=mx0.qq.com. [124.115.1.35], dsn=2.0.0, stat=Sent (Ok: queued as )

由此看出,本人认为pam_mysql本身已经正确和处理了用户和密码信息

应该还是sendmail配置或者sendmail本身问题。

这是本人配置sendmail非系统用户时的过程遇到的问题,希望有人能指点迷津。。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表