postfix+dovecot+ad集成認證問題- 依靠作者大力幫助,解決了
網上有這個資料,我正在測試,但是問題多多啊。 郵件用戶都是ad上的用戶。
目前的情況是:
1.telnet 110 用戶驗證都通過了
2.telnet 25 正常輸出
3.發送郵件時候,看到smtp認證已經通過,但是找不到收件人這個用戶,請看下面日誌
Nov 27 11:45:11 mail postfix/smtpd: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
Nov 27 11:45:19 mail postfix/smtpd: connect from unknown
Nov 27 11:45:19 mail postfix/smtpd: NOQUEUE: reject: RCPT from unknown: 550 5.1.1 <ding@sdys.com>: Recipient address rejected: User unknown in virtual mailbox table; from=<ding@sdys.com> to=<ding@sdys.com> proto=SMTP helo=<d>
Nov 27 11:45:19 mail postfix/smtpd: lost connection after RCPT from unknown
Nov 27 11:45:19 mail postfix/smtpd: disconnect from unknown
Nov 27 11:45:28 mail postfix/smtpd: connect from unknown
Nov 27 11:45:28 mail postfix/smtpd: NOQUEUE: reject: RCPT from unknown: 550 5.1.1 <ding@sdys.com>: Recipient address rejected: User unknown in virtual mailbox table; from=<ding@sdys.com> to=<ding@sdys.com> proto=ESMTP helo=<d>
Nov 27 11:45:34 mail postfix/smtpd: lost connection after RCPT from unknown
Nov 27 11:45:34 mail postfix/smtpd: disconnect from unknown
4. 但是對收件人做測試時正常的
# postmap -q dong@sdys.com ldap:/etc/postfix/ldap-users.cf
#
5. postfix的配置
readme_directory = no
myhostname = mail.sdys.com
mydomain = sdys.com
myorigin = $mydomain
mydestination = $myhostname,localhost.$mydomain,localhost
mynetworks = 127.0.0.0/8
home_mailbox = Maildir/
smtpd_sasl_type = dovecot
smtpd_sasl_path = /var/run/dovecot/auth-client
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
broken_sasl_auth_clients = yes
virtual_mailbox_base = /data/vmail
virtual_mailbox_domains = $mydomain
virtual_mailbox_maps = ldap:/etc/postfix/ldap-users.cf
virtual_transport = virtual
virtual_uid_maps = static:505
virtual_gid_maps = static:501
6. ldap-users.cf
# more /etc/postfix/ldap-users.cf
server_host = 10.167.53.242
search_base = dc=sdys,dc=com
version =3
query_filter = (&(objectclass=person)(|(mail=%s)(othermailbox=%s))(!(userAccountControl=66050)))
bind=yes
bind_dn = vmail@sdys.com
bind_pw = abc123!
result_attribute= samaccountname
result_format = %s/Maildir/
實在想不出啊,為什麼找不到用戶呢?
最終解決了,涉及多個方面的問題
1.dovecot-ldap.conf
dn = ding@sdys.com
dnpass = 123
auth_bind_userdn = sdys\%u
以上三個參數的區別是:
dn和dnpass是因為WIN2008 AD是不允許匿名綁定,所以需要先設置dn和dnpass參數,當和AD域綁寫成功后,需要根據當前正在LOGIN的用戶來查詢他的密碼,所以需要使用auth_bind_userdn來聲明當前正在LOGIN用戶的用戶名。
另外,要考慮03AD的域是否也有匿名綁定問題,所以都要使用dn dnpass
這裡是保障pop3正常的。
2. 多個配置文件中 , 字元 空格 括弧要嚴格檢查
因為這些錯誤不會明顯的報出來,我是一個字一個字閱讀,找到幾處關鍵錯誤。
3.ad中的用戶也需要郵箱的, 我發信找不到用戶,就是因為AD中用戶信息郵箱寫錯了 sdys 寫成syds了。。。
安裝記錄以後再寫吧。實在太忙
大家可以看作者的,我就靠他檢查出了問題
http://dengweihua1.blog.51cto.com
另外有個網站http://www.linuxmail.info/postfix-active-directory-ldap-lookup-howto/
[ 本帖最後由 very_99 於 2009-11-27 17:53 編輯 ]
《解決方案》
看用ldap能找到ding@sdys.com么?
dovcecot中的ldap部分呢?
《解決方案》
# more /etc/dovecot-ldap.conf
hosts = 10.167.53.242
base = dc=sdys,dc=com
ldap_version = 3
auth_bind = yes
auth_bind_userdn = sdys\%u
telnet 110 使用用戶和密碼都是通過的
《解決方案》
virtual_mailbox_base = /data/vmail
用戶的目錄看生成了么?
《解決方案》
用戶目錄在mail客戶端第一次登陸后,就會自動創建了。
現在都有的
《解決方案》
確認postfix的LDAP查詢正確,請運行以下命令:
#postmap –q test@test.com ldap:/etc/postfix/ldap-users.cf
以上命令中請確認test用戶存在,並在WINDOWS的「活動目錄用戶與計算機」中為test用戶的郵件地址設置為: test@test.com
如果返回:Test/Maildir/ 說明配置完全正確
http://dengweihua1.blog.51cto.com/134932/230797
《解決方案》
原帖由 anthonyfeng 於 2009-11-27 15:46 發表 http://bbs2.chinaunix.net/images/common/back.gif
確認postfix的LDAP查詢正確,請運行以下命令:
#postmap –q test@test.com ldap:/etc/postfix/ldap-users.cf
以上命令中請確認test用戶存在,並在WINDOWS的「活動目錄用戶與計算機」中為test用戶的郵件地 ...
現在這個博主正在幫我看配置呢。
#postmap –q test@test.com ldap:/etc/postfix/ldap-users.cf
這裡在http://www.linuxmail.info/postfix-active-directory-ldap-lookup-howto/ 上有說明,
其中也有斑竹回復了,也是有可能沒有出來回復的。
postmap -q group@acme.local ldap:/etc/postfix/ldap-groups.cf
Replace group@acme.local with your own valid group email. You should see the email addresses of the members.
後面有人問了,沒出來回饋信息。 但是也正常的。
《解決方案》
原帖由 anthonyfeng 於 2009-11-27 15:46 發表 http://bbs2.chinaunix.net/images/common/back.gif
確認postfix的LDAP查詢正確,請運行以下命令:
#postmap –q test@test.com ldap:/etc/postfix/ldap-users.cf
以上命令中請確認test用戶存在,並在WINDOWS的「活動目錄用戶與計算機」中為test用戶的郵件地 ...
這個博客上我正在貼帖子呢
《解決方案》
不知樓主是怎麼做這個系統的,AD server 和mail server 都放在公網?
考慮到AD server 這麼重要,不知postfix 能否使用只讀AD server ?
《解決方案》
AD server放在公網的很少吧