求救:SASL LOGIN authentication failed
遇到一個問題.不能通過客戶端收發郵件,日誌中出現.
Jan 1 10:01:34 localhost postfix/smtpd: warning: unknown: SASL LOGIN authentication failed: authentication failure
下面是我的postfix配置,麻煩各位指點一下.
root@mail postfix]# postconf -n
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
html_directory = no
mail_owner = postfix
mailq_path = /usr/bin/mailq
manpage_directory = /usr/local/man
message_size_limit = 14336000
mydomain = xxxx.com
myhostname = mail.xxxx.com
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = no
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
smtpd_banner = Welcome to our $myhostname ESMTP,Warning: Version not Available!
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_invalid_hostname,reject_non_fqdn_hostname,reject_unknown_sender_domain,reject_non_fqdn_sender,reject_non_fqdn_recipient,reject_unknown_recipient_domain,reject_unauth_pipelining,reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
unknown_local_recipient_reject_code = 550
virtual_alias_domains =
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_gid_maps = static:689
virtual_mailbox_base = /var/mailbox
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_limit = 20971520
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_minimum_uid = 89
virtual_transport = virtual
virtual_uid_maps = static:689
《解決方案》
很奇怪,我安裝完sasl2后,沒有smtpd.conf這個文件,於是,我自己建了一個,內容如下:
# more /usr/local/sasl2/lib/sasl2/smtpd.conf
pwcheck_method:authdaemond
log_level: 3
mech_list:PLAIN LOGIN
authdaemond_path:/var/spool/authdaemon/socket
《解決方案》
# more authmysqlrc
MYSQL_SERVER localhost
MYSQL_USERNAME extmail
MYSQL_PASSWORD extmail
MYSQL_SOCKET /var/lib/mysql/mysql.sock
MYSQL_PORT 3306
MYSQL_OPT 0
MYSQL_DATABASE extmail
MYSQL_USER_TABLE mailbox
MYSQL_CRYPT_PWFIELD password
MYSQL_UID_FIELD '689'
MYSQL_GID_FIELD '689'
MYSQL_LOGIN_FIELD username
MYSQL_HOME_FIELD '/var/mailbox'
MYSQL_NAME_FIELD name
MYSQL_MAILDIR_FIELD '/var/mailbox'
MYSQL_QUOTA_FIELD quota
MYSQL_WHERE_CLAUSE active='1'
DEFAULT_DOMAIN xxxx.com
《解決方案》
# more authdaemonrc|grep -v '^#'
authmodulelist="authmysql"
authmodulelistorig="authmysql"
daemons=10
authdaemonvar=/var/spool/authdaemon
DEBUG_LOGIN=2
DEFAULTOPTIONS=""
LOGGEROPTS=""
subsystem=mail
《解決方案》
testsaslauthd測試本機的用戶名和密碼能通過的
《解決方案》
但是用smtp 也不能認證
# testsaslauthd -s smtp -u test@xxxx.com -p test123
0: NO "authentication failed"
Jan 1 10:23:07 localhost authdaemond: received auth request, service=login, authtype=login
Jan 1 10:23:07 localhost authdaemond: authmysql: trying this module
Jan 1 10:23:07 localhost authdaemond: SQL query: SELECT username., password., "", '89'., '89', concat('/var/mailbox/',homedir)., concat('/var/mailbox/',maildir)., "", name, "" FROM mailbox. WHERE username. = "test@xxxx.com"
Jan 1 10:23:07 localhost authdaemond: supplied password '-ptest123' does not match encrypted password '$1$KwaEyhc/$2mVDfXXiGzCuegrlHg1jT/'
Jan 1 10:23:07 localhost authdaemond: authmysql: REJECT - try next module
Jan 1 10:23:07 localhost authdaemond: FAIL, all modules rejected
奇怪,這個'89'., '89'是從那裡來的呢?
重啟authdaemond后, 上面的錯誤變成
Jan 1 10:31:03 localhost authdaemond: modules="authmysql", daemons=10
Jan 1 10:31:03 localhost authdaemond: Installing libauthmysql
Jan 1 10:31:03 localhost authdaemond: Installation complete: authmysql
看來個'89'., '89' 是未重啟authdaemond造成的
[ 本帖最後由 yuantong 於 2009-1-1 10:42 編輯 ]
《解決方案》
# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 Welcome to our mail.xxxx.com ESMTP,Warning: Version not Available!
ehlo xxxx.com
250-mail.xxxx.com
250-PIPELINING
250-SIZE 14336000
250-VRFY
250-ETRN
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
AUTH LOGIN
334 VXNlcm5hbWU6
dGVzdEAzY29vYy5jb20AdGVzdA==
334 UGFzc3dvcmQ6
dGVzdEAzY29vYy5jb20AdGVzdDEyMw==
535 5.7.8 Error: authentication failed: authentication failure
《解決方案》
Jan 1 10:23:07 localhost authdaemond: supplied password '-ptest123' does not match encrypted password '$1$KwaEyhc/$2mVDfXXiGzCuegrlHg1jT/'
《解決方案》
樓上的兄弟,你不見我重啟過authdaemond
你所帖的錯誤已經解決了嗎?
現在的錯誤是
535 5.7.8 Error: authentication failed: authentication failure
《解決方案》
原帖由 yuantong 於 2009-1-1 20:41 發表 http://bbs.chinaunix.net/images/common/back.gif
樓上的兄弟,你不見我重啟過authdaemond
你所帖的錯誤已經解決了嗎?
現在的錯誤是
535 5.7.8 Error: authentication failed: authentication failure
你沒有仔細看樓上的
你的還是認證失敗
上次報的是密碼不匹配,你看看你這次的日誌還是不是呀?
你telnet顯示的也還認證失敗