歡迎您光臨本站 註冊首頁

求助:postfix+sasl2+mysql+extman+extmail的SMTP認證通不過

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

求助:postfix+sasl2+mysql+extman+extmail的SMTP認證通不過

求助:postfix+sasl2+mysql+extman+extmail的SMTP認證通不過
驗證提示 535 錯誤
可以收信,不可以發信 webmail可以發
如果說SQL模塊錯誤,POP3驗證又沒事哦,真是奇怪,我的smtp認證是用的daemond
daemond運行是正常的
日誌里明明有提示密碼驗證已經通過,為什麼又出錯呢

maillogJan 20 08:25:45 www postfix/smtpd: connect from unknown
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
Jan 20 08:25:45 www postfix/smtpd: warning: SASL authentication failure: could not verify password
Jan 20 08:25:45 www authdaemond: Authenticated: clearpasswd=test, passwd=$1$daGMb0Yk$dzf/LtnIl38yETXh21D5K1
Jan 20 08:25:45 www postfix/smtpd: warning: unknown: SASL LOGIN authentication failed: generic failure
Jan 20 08:25:45 www postfix/smtpd: lost connection after AUTH from unknown
Jan 20 08:25:45 www postfix/smtpd: disconnect from unknown
auth.log
Jan 20 08:25:45 www postfix/smtpd: sql_select option missing
Jan 20 08:25:45 www postfix/smtpd: auxpropfunc error no mechanism available
debug.log
Jan 20 08:25:45 www postfix/smtpd: _sasl_plugin_load failed on sasl_auxprop_plug_init for plugin: sql
Jan 20 08:25:45 www authdaemond: received auth request, service=smtp, authtype=login
Jan 20 08:25:45 www authdaemond: authmysql: trying this module
Jan 20 08:25:45 www authdaemond: authmysqllib: connected. Versions: header 50089, client 50089, server 50089
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')
Jan 20 08:25:45 www authdaemond: password matches successfully
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
Jan 20 08:25:45 www authdaemond: authmysql: clearpasswd=<null>, passwd=$1$daGMb0Yk$dzf/LtnIl38yETXh21D5K1


smtpd.conf

pwcheck_method: authdaemond
log_level: 8
mech_list: plain login
authdaemond_path:/var/run/authdaemond/socket

#pwcheck_method: auxprop
auxprop_plugin: sql
allowanonymouslogin: no
allowplaintext: yes
mech_list: PLAIN LOGIN
srp_mda: md5
password_format: crypt

sql_engine: mysql
sql_hostnames: localhost
sql_user: tlmail
sql_passwd: tlmail
sql_database: tlmail
sql_select: select password from mailbox where username='%u@%r' and active='1'

《解決方案》

感覺是 smtpd.conf 文件的配置問題。你看一下:http://pieps.org/cyrus

Jan 20 08:25:45 www postfix/smtpd: 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 編輯 ]
《解決方案》

回復 #2 iheaing 的帖子

很明顯是smtpd.conf的問題。


pwcheck_method: authdaemond
log_level: 8
mech_list: plain login
authdaemond_path:/var/run/authdaemond/socket


試試改成這個。
《解決方案》

改了還是一樣不行,最開始是沒有下面一段的
《解決方案》

我也希望是smtpd.conf問題啊,
從debug.log來看,auth是已經通過了的,為什麼到了maillog里,就變成密碼不匹配了呢?
《解決方案》

回復 #5 loveme99 的帖子

改好后提供認證日誌。
《解決方案》

改過後的日誌

maillog

Jan 20 14:24:19 www postfix/smtpd: connect from unknown
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>
Jan 20 14:24:19 www authdaemond: Authenticated: clearpasswd=test, passwd=$1$5g9XL$7eg2pKICZw3fZuvvMYROP/
Jan 20 14:24:19 www postfix/smtpd: warning: SASL authentication failure: could not verify password
Jan 20 14:24:19 www postfix/smtpd: warning: unknown: SASL LOGIN authentication failed: generic failure
Jan 20 14:24:19 www postfix/smtpd: lost connection after AUTH from unknown
Jan 20 14:24:19 www postfix/smtpd: disconnect from unknown



debug.log

Jan 20 14:24:19 www postfix/smtpd: _sasl_plugin_load failed on sasl_auxprop_plug_init for plugin: sql
Jan 20 14:24:19 www authdaemond: received auth request, service=smtp, authtype=login
Jan 20 14:24:19 www authdaemond: authmysql: trying this module
Jan 20 14:24:19 www authdaemond: authmysqllib: connected. Versions: header 50089, client 50089, server 50089
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'
Jan 20 14:24:19 www authdaemond: password matches successfully
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>
Jan 20 14:24:19 www authdaemond: authmysql: clearpasswd=<null>, passwd=$1$5g9XL$7eg2pKICZw3fZuvvMYROP/


auth.log


Jan 20 14:24:19 www postfix/smtpd: sql_select option missing
Jan 20 14:24:19 www postfix/smtpd: auxpropfunc error no mechanism available


smtpd.conf

pwcheck_method: authdaemond
log_level: 8
mech_list: plain login
authdaemond_path:/var/run/authdaemond/socket


[ 本帖最後由 loveme99 於 2010-1-20 14:35 編輯 ]
《解決方案》

回復 #7 loveme99 的帖子

/var/run/authdaemond/socket
這個文件有?
《解決方案》

有啊,

www# ls /var/run/authdaemond/socket
/var/run/authdaemond/socket
《解決方案》

我貼出我的 main.cf吧

#queue_directory = /var/spool/postfix
command_directory = /usr/local/sbin
#daemon_directory = /usr/local/libexec/postfix

#data_directory = /var/db/postfix

#mail_owner = postfix
#default_privs = nobody

#relay_domains = $mydestination

debug_peer_level = 2
sendmail_path = /usr/local/sbin/sendmail

newaliases_path = /usr/local/bin/newaliases
mailq_path = /usr/local/bin/mailq

#setgid_group = maildrop

#html_directory = /usr/local/share/doc/postfix
#manpage_directory = /usr/local/man
#sample_directory = /usr/local/etc/postfix
#readme_directory = /usr/local/share/doc/postfix


#--------------ADD END------------------------

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

myhostname = tailigo.com
smtp_helo_name = $myhostname

local_transport = maildrop
mailbox_transport = maildrop

virtual_mailbox_base = /var/mail

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

####################MYSQL###################
mydestination     =   mysql:/usr/local/etc/postfix/mysql-mydest.cf
virtual_transport_maps     = mysql:/usr/local/etc/postfix/mysql-transport.cf
virtual_alias_maps       = mysql:/usr/local/etc/postfix/mysql-alias.cf
virtual_alias_domains = $virtual_alias_maps
recipient_bcc_maps = mysql:/usr/local/etc/postfix/mysql-autobbc-in.cf
sender_bcc_maps = mysql:/usr/local/etc/postfix/mysql-autobbc-out.cf
virtual_mailbox_domains = mysql:/usr/local/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps = mysql:/usr/local/etc/postfix/mysql-virtual-mailbox-maps.cf
local_recipient_maps = $virtual_mailbox_maps
virtual_uid_maps     = mysql:/usr/local/etc/postfix/mysql-virtual-uid.cf
virtual_gid_maps     = mysql:/usr/local/etc/postfix/mysql-virtual-gid.cf


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


##########################SASL###################
#smtpd_sender_login_maps = mysql:/usr/local/etc/postfix/mysql-smtplogin.cf
#smtpd_reject_unlisted_sender = yes
smtpd_sasl_auth_enable     = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients   = yes
smtpd_delay_reject = yes
smtpd_sasl_local_domain = ''


#smtpd_peername_lookup = no
#smtpd_proxy_timeout = 180s
smtpd_recipient_restrictions =
    permit_mynetworks,
#    check_client_access mysql:/usr/local/etc/postfix/mysql-access.cf,
    permit_sasl_authenticated,
    reject_non_fqdn_hostname,
    reject_non_fqdn_sender,
    reject_non_fqdn_recipient,
    reject_unknown_recipient_domain,
    reject_unknown_sender_domain,
#    reject_unauth_pipelining,
    reject_unauth_destination,
#    reject_rbl_client cblless.anti-spam.org.cn,
#    permit
smtpd_client_restrictions = permit_sasl_authenticated
#smtp_etrn_restrictions = permit_mynetworks,reject

default_destination_recipient_limit = 1
local_destination_concurrency_limit = 1
maildrop_destination_recipient_limit = 1
#smtpd_error_sleep_time = 0
#smtpd_soft_error_limit = 10
#smtpd_hard_error_limit = 20
#default_process_limit = 500

message_size_limit = 41943040

smtpd_recipient_limit = 10
bounce_queue_lifetime = 12h
maximal_queue_lifetime = 24h

smtpd_helo_required = yes
strict_rfc821_envelopes = yes


[火星人 ] 求助:postfix+sasl2+mysql+extman+extmail的SMTP認證通不過已經有1019次圍觀

http://coctec.com/docs/service/show-post-13915.html