Chinaunix

标题: 求助:postfix+sasl2+mysql+extman+extmail的SMTP认证通不过 [打印本页]

作者: loveme99    时间: 2010-01-20 11:51
标题: 求助:postfix+sasl2+mysql+extman+extmail的SMTP认证通不过
求助:postfix+sasl2+mysql+extman+extmail的SMTP认证通不过
验证提示 535 错误
可以收信,不可以发信 webmail可以发
如果说SQL模块错误,POP3验证又没事哦,真是奇怪,我的smtp认证是用的daemond
daemond运行是正常的
日志里明明有提示密码验证已经通过,为什么又出错呢

maillog
  1. Jan 20 08:25:45 www postfix/smtpd[28535]: connect from unknown[119.145.251.18]
  2. Jan 20 08:25:45 www authdaemond: Authenticated: sysusername=<null>, sysuserid=1003, sysgroupid=1003, homedir=/var/mail/zs-taili.cn/sam, address=sam@zs-taili.cn, fullname=sam, maildir=/var/mail/zs-taili.cn/sam/Maildir/, quota=524288000S, options=disableimap=0,disablepop3=0,disablewebmail=0
  3. Jan 20 08:25:45 www postfix/smtpd[28535]: warning: SASL authentication failure: could not verify password
  4. Jan 20 08:25:45 www authdaemond: Authenticated: clearpasswd=test, passwd=$1$daGMb0Yk$dzf/LtnIl38yETXh21D5K1
  5. Jan 20 08:25:45 www postfix/smtpd[28535]: warning: unknown[119.145.251.18]: SASL LOGIN authentication failed: generic failure
  6. Jan 20 08:25:45 www postfix/smtpd[28535]: lost connection after AUTH from unknown[119.145.251.18]
  7. Jan 20 08:25:45 www postfix/smtpd[28535]: disconnect from unknown[119.145.251.18]
复制代码
auth.log

  1. Jan 20 08:25:45 www postfix/smtpd[28535]: sql_select option missing
  2. Jan 20 08:25:45 www postfix/smtpd[28535]: auxpropfunc error no mechanism available
复制代码
debug.log

  1. Jan 20 08:25:45 www postfix/smtpd[28535]: _sasl_plugin_load failed on sasl_auxprop_plug_init for plugin: sql
  2. Jan 20 08:25:45 www authdaemond: received auth request, service=smtp, authtype=login
  3. Jan 20 08:25:45 www authdaemond: authmysql: trying this module
  4. Jan 20 08:25:45 www authdaemond: authmysqllib: connected. Versions: header 50089, client 50089, server 50089
  5. Jan 20 08:25:45 www authdaemond: SQL query: SELECT username, password, clearpwd, uidnumber, gidnumber, CONCAT('/var/mail/',homedir), CONCAT('/var/mail/',maildir), quota, name, CONCAT("disableimap=",disableimap,",disablepop3=",disablepop3,",disablewebmail=",disablewebmail) FROM mailbox WHERE username = 'sam@zs-taili.cn'  AND (active='1')
  6. Jan 20 08:25:45 www authdaemond: password matches successfully
  7. Jan 20 08:25:45 www authdaemond: authmysql: sysusername=<null>, sysuserid=1003, sysgroupid=1003, homedir=/var/mail/zs-taili.cn/sam, address=sam@zs-taili.cn, fullname=sam, maildir=/var/mail/zs-taili.cn/sam/Maildir/, quota=524288000S, options=disableimap=0,disablepop3=0,disablewebmail=0
  8. Jan 20 08:25:45 www authdaemond: authmysql: clearpasswd=<null>, passwd=$1$daGMb0Yk$dzf/LtnIl38yETXh21D5K1
复制代码


smtpd.conf

  1. pwcheck_method: authdaemond
  2. log_level: 8
  3. mech_list: plain login
  4. authdaemond_path:/var/run/authdaemond/socket

  5. #pwcheck_method: auxprop
  6. auxprop_plugin: sql
  7. allowanonymouslogin: no
  8. allowplaintext: yes
  9. mech_list: PLAIN LOGIN
  10. srp_mda: md5
  11. password_format: crypt

  12. sql_engine: mysql
  13. sql_hostnames: localhost
  14. sql_user: tlmail
  15. sql_passwd: tlmail
  16. sql_database: tlmail
  17. sql_select: select password from mailbox where username='%u@%r' and active='1'

复制代码

作者: iheaing    时间: 2010-01-20 11:56
感觉是 smtpd.conf 文件的配置问题。你看一下:http://pieps.org/cyrus

Jan 20 08:25:45 www postfix/smtpd[28535]: sql_select option missing

select password from mailbox where username='%u@%r' and active='1' 我没用过 Extmail,它有 mailbox 这个表有 有 username/password这字段?

[ 本帖最后由 iheaing 于 2010-1-20 11:59 编辑 ]
作者: scyzxp    时间: 2010-01-20 12:00
标题: 回复 #2 iheaing 的帖子
很明显是smtpd.conf的问题。


  1. pwcheck_method: authdaemond
  2. log_level: 8
  3. mech_list: plain login
  4. authdaemond_path:/var/run/authdaemond/socket
复制代码


试试改成这个。
作者: loveme99    时间: 2010-01-20 13:33
改了还是一样不行,最开始是没有下面一段的
作者: loveme99    时间: 2010-01-20 13:36
我也希望是smtpd.conf问题啊,
从debug.log来看,auth是已经通过了的,为什么到了maillog里,就变成密码不匹配了呢?
作者: scyzxp    时间: 2010-01-20 13:49
标题: 回复 #5 loveme99 的帖子
改好后提供认证日志。
作者: loveme99    时间: 2010-01-20 14:31
改过后的日志

maillog

  1. Jan 20 14:24:19 www postfix/smtpd[49062]: connect from unknown[119.145.251.18]
  2. Jan 20 14:24:19 www authdaemond: Authenticated: sysusername=<null>, sysuserid=1003, sysgroupid=1003, homedir=/var/mail/zs-taili.cn/sam, address=sam@zs-taili.cn, fullname=sam, maildir=/var/mail/zs-taili.cn/sam/Maildir/, quota=524288000S, options=<null>
  3. Jan 20 14:24:19 www authdaemond: Authenticated: clearpasswd=test, passwd=$1$5g9XL$7eg2pKICZw3fZuvvMYROP/
  4. Jan 20 14:24:19 www postfix/smtpd[49062]: warning: SASL authentication failure: could not verify password
  5. Jan 20 14:24:19 www postfix/smtpd[49062]: warning: unknown[119.145.251.18]: SASL LOGIN authentication failed: generic failure
  6. Jan 20 14:24:19 www postfix/smtpd[49062]: lost connection after AUTH from unknown[119.145.251.18]
  7. Jan 20 14:24:19 www postfix/smtpd[49062]: disconnect from unknown[119.145.251.18]
复制代码



debug.log

  1. Jan 20 14:24:19 www postfix/smtpd[49062]: _sasl_plugin_load failed on sasl_auxprop_plug_init for plugin: sql
  2. Jan 20 14:24:19 www authdaemond: received auth request, service=smtp, authtype=login
  3. Jan 20 14:24:19 www authdaemond: authmysql: trying this module
  4. Jan 20 14:24:19 www authdaemond: authmysqllib: connected. Versions: header 50089, client 50089, server 50089
  5. Jan 20 14:24:19 www authdaemond: SQL query: SELECT username,password,"",uidnumber,gidnumber,CONCAT('/var/mail/',homedir),CONCAT('/var/mail/',maildir), quota, name FROM mailbox WHERE username = 'sam@zs-taili.cn'
  6. Jan 20 14:24:19 www authdaemond: password matches successfully
  7. Jan 20 14:24:19 www authdaemond: authmysql: sysusername=<null>, sysuserid=1003, sysgroupid=1003, homedir=/var/mail/zs-taili.cn/sam, address=sam@zs-taili.cn, fullname=sam, maildir=/var/mail/zs-taili.cn/sam/Maildir/, quota=524288000S, options=<null>
  8. Jan 20 14:24:19 www authdaemond: authmysql: clearpasswd=<null>, passwd=$1$5g9XL$7eg2pKICZw3fZuvvMYROP/
复制代码


auth.log


  1. Jan 20 14:24:19 www postfix/smtpd[49062]: sql_select option missing
  2. Jan 20 14:24:19 www postfix/smtpd[49062]: auxpropfunc error no mechanism available
复制代码


smtpd.conf

  1. pwcheck_method: authdaemond
  2. log_level: 8
  3. mech_list: plain login
  4. authdaemond_path:/var/run/authdaemond/socket
复制代码

[ 本帖最后由 loveme99 于 2010-1-20 14:35 编辑 ]
作者: scyzxp    时间: 2010-01-20 14:43
标题: 回复 #7 loveme99 的帖子
/var/run/authdaemond/socket
这个文件有?
作者: loveme99    时间: 2010-01-20 15:21
有啊,

  1. www# ls /var/run/authdaemond/socket
  2. /var/run/authdaemond/socket
复制代码

作者: loveme99    时间: 2010-01-20 15:26
我贴出我的 main.cf吧

  1. #queue_directory = /var/spool/postfix
  2. command_directory = /usr/local/sbin
  3. #daemon_directory = /usr/local/libexec/postfix

  4. #data_directory = /var/db/postfix

  5. #mail_owner = postfix
  6. #default_privs = nobody

  7. #relay_domains = $mydestination

  8. debug_peer_level = 2
  9. sendmail_path = /usr/local/sbin/sendmail

  10. newaliases_path = /usr/local/bin/newaliases
  11. mailq_path = /usr/local/bin/mailq

  12. #setgid_group = maildrop

  13. #html_directory = /usr/local/share/doc/postfix
  14. #manpage_directory = /usr/local/man
  15. #sample_directory = /usr/local/etc/postfix
  16. #readme_directory = /usr/local/share/doc/postfix


  17. #--------------ADD END------------------------

  18. ########################BASE#################
  19. bounce_template_file = /usr/local/etc/postfix/bounce.cf

  20. myhostname = tailigo.com
  21. smtp_helo_name = $myhostname

  22. local_transport = maildrop
  23. mailbox_transport = maildrop

  24. virtual_mailbox_base = /var/mail

  25. #alias_maps       = hash:/usr/local/etc/postfix/aliases
  26. #Alias_database         = hash:/usr/local/etc/postfix/aliases

  27. ####################MYSQL###################
  28. mydestination     =   mysql:/usr/local/etc/postfix/mysql-mydest.cf
  29. virtual_transport_maps     = mysql:/usr/local/etc/postfix/mysql-transport.cf
  30. virtual_alias_maps       = mysql:/usr/local/etc/postfix/mysql-alias.cf
  31. virtual_alias_domains = $virtual_alias_maps
  32. recipient_bcc_maps = mysql:/usr/local/etc/postfix/mysql-autobbc-in.cf
  33. sender_bcc_maps = mysql:/usr/local/etc/postfix/mysql-autobbc-out.cf
  34. virtual_mailbox_domains = mysql:/usr/local/etc/postfix/mysql-virtual-mailbox-domains.cf
  35. virtual_mailbox_maps = mysql:/usr/local/etc/postfix/mysql-virtual-mailbox-maps.cf
  36. local_recipient_maps = $virtual_mailbox_maps
  37. virtual_uid_maps     = mysql:/usr/local/etc/postfix/mysql-virtual-uid.cf
  38. virtual_gid_maps     = mysql:/usr/local/etc/postfix/mysql-virtual-gid.cf


  39. #####################Quota#######################
  40. virtual_create_maildirsize = yes
  41. virtual_mailbox_extended = yes
  42. virtual_mailbox_limit_maps = mysql:/usr/local/etc/postfix/mysql-virtual-quota.cf
  43. virtual_mailbox_limit_override = yes
  44. virtual_maildir_limit_message = Sorry, the user's maildir has overdrawn his diskspace quota, please try again later.
  45. virtual_overquota_bounce = yes


  46. ##########################SASL###################
  47. #smtpd_sender_login_maps = mysql:/usr/local/etc/postfix/mysql-smtplogin.cf
  48. #smtpd_reject_unlisted_sender = yes
  49. smtpd_sasl_auth_enable     = yes
  50. smtpd_sasl_security_options = noanonymous
  51. broken_sasl_auth_clients   = yes
  52. smtpd_delay_reject = yes
  53. smtpd_sasl_local_domain = ''


  54. #smtpd_peername_lookup = no
  55. #smtpd_proxy_timeout = 180s
  56. smtpd_recipient_restrictions =
  57.     permit_mynetworks,
  58. #    check_client_access mysql:/usr/local/etc/postfix/mysql-access.cf,
  59.     permit_sasl_authenticated,
  60.     reject_non_fqdn_hostname,
  61.     reject_non_fqdn_sender,
  62.     reject_non_fqdn_recipient,
  63.     reject_unknown_recipient_domain,
  64.     reject_unknown_sender_domain,
  65. #    reject_unauth_pipelining,
  66.     reject_unauth_destination,
  67. #    reject_rbl_client cblless.anti-spam.org.cn,
  68. #    permit
  69. smtpd_client_restrictions = permit_sasl_authenticated
  70. #smtp_etrn_restrictions = permit_mynetworks,reject

  71. default_destination_recipient_limit = 1
  72. local_destination_concurrency_limit = 1
  73. maildrop_destination_recipient_limit = 1
  74. #smtpd_error_sleep_time = 0
  75. #smtpd_soft_error_limit = 10
  76. #smtpd_hard_error_limit = 20
  77. #default_process_limit = 500

  78. message_size_limit = 41943040

  79. smtpd_recipient_limit = 10
  80. bounce_queue_lifetime = 12h
  81. maximal_queue_lifetime = 24h

  82. smtpd_helo_required = yes
  83. strict_rfc821_envelopes = yes

复制代码

作者: scyzxp    时间: 2010-01-20 15:40
标题: 回复 #8 scyzxp 的帖子
POP3能通过吗?
作者: loveme99    时间: 2010-01-20 17:53
POP3是完全没有问题,可以收到信
作者: iheaing    时间: 2010-01-20 17:59
看日志和我前几天的情况一样,我的 smtpd.conf 内容如下:

pwcheck_method: auxprop
log_level: 3
mech_list: PLAIN LOGIN
auxprop_plugin: sql
allowanonymouslogin: no
allowplaintext: yes
srp_mda: md5
srvtab: /dev/null
opiekeys: /dev/null
password_format: crypt
sql_engine: pgsql
sql_hostnames: 192.168.1.2
sql_user: mail
sql_passwd: mailer
sql_database: pmail
sql_select: SELECT password FROM mailbox WHERE username = '%u@%r' AND active = true

我使用的是在另一台机器上的 postgresql,表是通过 postfixadmin 建立的,保密的密码是经过加密的。
作者: loveme99    时间: 2010-01-20 22:29
我一早已经试过用
pwcheck_method: auxprop

可结果还是一样,弄得我头都大了,真不知道是哪里出了问题
作者: loveme99    时间: 2010-01-21 09:14
今天再顶一下,看看有没有谁帮帮俺
作者: iheaing    时间: 2010-01-21 10:34
原帖由 loveme99 于 2010-1-21 09:14 发表
今天再顶一下,看看有没有谁帮帮俺



数据库里保存的密码是加密的吗?SASL2要打补丁才能支持密码加密。
作者: scyzxp    时间: 2010-01-21 11:55
标题: 回复 #15 loveme99 的帖子
如果把服务器密码PM我。的话,应该两分钟就可以解决。
作者: loveme99    时间: 2010-01-25 08:12
感谢,终于搞掂了,按照高手的方法,给sasl2打上补丁,用sql认证终于给通过了,谢谢
作者: scyzxp    时间: 2010-01-25 10:11
标题: 回复 #18 loveme99 的帖子
嘿嘿。
作者: stuartjing    时间: 2011-10-13 10:45
楼主,我和你的问题一样啊,你怎么解决的,求指点。




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2