歡迎您光臨本站 註冊首頁

postfix疑難問題求助。

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

postfix疑難問題求助。

我的環境為solaris10+cyrus-sasl-2.1.19+postfix-2.0.20+mysql5.0,我的目的就是想實現支持sasl+mysql認證的postfix。現遇到了問題,如下:

postfix啟動成功,可以telnet 25埠,但是認證無法通過,日誌提示"SASL LOGIN authentication failed」,僅此一條錯誤日誌。我察看mysql的查詢日誌,發現根本沒有相應的記錄。但是mysql有其他的日誌,如「070405 10:02:47      99 Query       select description from domain where domain = 'betcn.com」,這個是試圖通過我的伺服器做中繼的日誌。

我現在懷疑是postfix與sasl之間的連接出了問題,但我沒有思路該如何繼續排查下去。忘大家多多指點。

還有一個問題,postfix是在哪裡指定/usr/lib/sasl2/smtpd.conf這個文件的位置呢?多謝。
《解決方案》

main.cf 如下:
myhostname = mail.wework.cn
mydomain = wework.com
myorigin = $wework.com
mydestination = $mail.wework.com localhost localhost.$wework.com
mynetworks = 127.0.0.0/8
inet_interfaces = all

#=====================Vritual Mailbox settings=========================
virtual_mailbox_base = /var/mailbox
virtual_mailbox_maps = mysql:/etc/postfix/mysql/mysql_virtual_mailbox_maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql/mysql_virtual_domains_maps.cf
virtual_alias_domains =
virtual_alias_maps = mysql:/etc/postfix/mysql/mysql_virtual_alias_maps.cf
virtual_uid_maps = static:1001
virtual_gid_maps = static:1001
virtual_transport = maildrop
maildrop_destination_recipient_limit = 1
maildrop_destination_concurrency_limit = 1

#====================QUOTA========================
message_size_limit = 14336000
virtual_mailbox_limit = 20971520
virtual_create_maildirsize = yes
virtual_mailbox_extended = yes
virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql/mysql_virtual_mailbox_limit_maps.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=====================
broken_sasl_auth_clients = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_application_name = smtpd
broken_sasl_auth_clients = yes
smtpd_sasl_local_domain = wework.cn
smtpd_recipient_restrictions = reject_unauth_destination


/usr/lib/sasl2/smtpd.conf 如下:
pwcheck_method: auxprop
auxprop_plugin: sql
mech_list: plain login
sql_engine: mysql
sql_hostnames: localhost
sql_user: postfix
sql_passwd: postfix
sql_database: postfix
sql_select: SELECT password FROM mailbox WHERE username='%u@%r' and domain='%r' and active='1'


其他如下:
cat mysql_virtual_alias_maps.cf               
user = postfix
password = postfix
hosts = localhost
dbname = postfix
table = alias
select_field = goto
where_field = address


cat mysql_virtual_mailbox_limit_maps.cf
user = postfix
password = postfix
hosts = localhost
dbname = postfix
table = mailbox
select_field = quota
where_field = username
#additional_conditions = and active = '1'


cat mysql_virtual_domains_maps.cf
user = postfix
password = postfix
hosts = localhost
dbname = postfix
table = domain
select_field = description
where_field = domain


cat mysql_virtual_mailbox_maps.cf
user = postfix
password = postfix
hosts = localhost
dbname = postfix
table = mailbox
select_field = maildir
where_field = username
#additional_conditions = and active = '1'

在我開啟登陸日誌查詢後日志如下:
< unknown: AUTH LOGIN
Apr  5 10:36:12 mail postfix/smtpd: smtpd_sasl_authenticate: sasl_method LOGIN
Apr  5 10:36:12 mail postfix/smtpd: smtpd_sasl_authenticate: uncoded challenge: Username:
Apr  5 10:36:12 mail postfix/smtpd: > unknown: 334 VXNlcm5hbWU6
Apr  5 10:36:12 mail postfix/smtpd: < unknown: ZGRsQHdld29yay5jbg==
Apr  5 10:36:12 mail postfix/smtpd: smtpd_sasl_authenticate: decoded response: 123@wework.cn
Apr  5 10:36:12 mail postfix/smtpd: smtpd_sasl_authenticate: uncoded challenge: Password:
Apr  5 10:36:12 mail postfix/smtpd: > unknown: 334 UGFzc3dvcmQ6
Apr  5 10:36:13 mail postfix/smtpd: < unknown: IGFzZG0uLg==
Apr  5 10:36:13 mail postfix/smtpd: smtpd_sasl_authenticate: decoded response:  123
Apr  5 10:36:13 mail postfix/smtpd: warning: unknown: SASL LOGIN authentication failed
Apr  5 10:36:13 mail postfix/smtpd: > unknown: 535 Error: authentication failed
Apr  5 10:36:14 mail postfix/smtpd: watchdog_pat: 823b938
Apr  5 10:36:14 mail postfix/smtpd: < unknown: QUIT
Apr  5 10:36:14 mail postfix/smtpd: > unknown: 221 Bye

[ 本帖最後由 yangtw 於 2007-4-5 10:38 編輯 ]
《解決方案》

我編譯postfix與sals的過程如下:

postfix
make -f Makefile.init makefiles \
'CCARGS=-DHAS_MYSQL -I/usr/local/mysql/include -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/local/include/sasl' \
'AUXLIBS=-L/usr/local/mysql/lib -lmysqlclient -lz -lm -L/usr/local/lib -lsasl2'

sals
./configure --enable-sample=no \
                  --enable-java=no \
                  --enable-alwaystrue=no \
                  --enable-checkapop=no \
                  --enable-cram=no \
                  --enable-digest=no \
                  --enable-otp=no \
                  --enable-krb4=no \
                  --enable-gssapi=no \
                  --enable-plain=yes \
                  --enable-login=yes \
                  --enable-ntlm=no \
                  --enable-anon=no \
                  --enable-sql=yes \
                  --with-mysql=/usr/local/mysql\
                  --with-pgsql=no\

[ 本帖最後由 yangtw 於 2007-4-5 10:49 編輯 ]
《解決方案》

這裡肯定高手雲集,還忘大家不吝賜教。
《解決方案》

求助…………
《解決方案》

焦急的等待……
《解決方案》

……
《解決方案》

失望!
《解決方案》

是不是密碼查詢方式與存儲方式不匹配?比如一個是加密的,一個是明文的
《解決方案》

原帖由 foreman2002 於 2007-4-11 10:47 發表
是不是密碼查詢方式與存儲方式不匹配?比如一個是加密的,一個是明文的
也許有這可能,我該怎麼去看加密或者明文呢? 這方面我是個新手, 謝謝指導。

[火星人 ] postfix疑難問題求助。已經有433次圍觀

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