![AD + Postfix + Dovecot 的 query_filter 问题](https://linux22.com/image/550932/AD%20%2B%20Postfix%20%2B%20Dovecot%20%E7%9A%84%20query_filter%20%E9%97%AE%E9%A2%98.png)
我设置了一个邮件服务器 AD + Postfix + Dovecot + Kerberos
这仅适用于属性中的一个域[电子邮件保护], 在[电子邮件保护],[电子邮件保护]
配置文件:
Postfix ldap-users.cf
server_host = server
search_base = dc=cn,dc=energy
version = 3
bind = yes
bind_dn = [email protected]
bind_pw = passwd
query_filter = (&(objectCategory=person)(|(mail=%s)(otherMailbox=%s))(!(userAccountControl=514)))
result_attribute = mail otherMailbox
result_format = %d/%u
dovecot-ldap.conf
hosts = server:3268
debug_level = 2
dn = ldapmail
dnpass = passwd
tls = no
auth_bind = yes
auth_bind_userdn = cn.energy\%u
ldap_version = 3
base = dc=cn, dc=energy
deref = searching
scope = subtree
user_attrs = mail=user,uid=vmail, gid=vmail
user_filter = (&(objectclass=person)(|(sAMAccountName=%n)(otherMailbox=%n))(!(userAccountControl=514)))
default_pass_scheme = CRYPT
后配置:
属性邮件
postmap -q [email protected] ldap:/etc/postfix/ldap-users.cf
another.net/petya,otherdoamin.com/vasya,[email protected]/ross
属性 otherMailbox
postmap -q [email protected] ldap:/etc/postfix/ldap-users.cf
another.net/petya,otherdoamin.com/vasya,[email protected]/ross
过滤器搜索并找到正确的。只是不起作用 result_format ???
例子:
another.net/petya,otherdoamin.com/vasya,[email protected]/ross
这个名字一个目录!嗯,dovecot 找不到它
非常感谢您的帮助。
答案1
您的问题是,postfix ldap 查询有效,而 dovecot ldap 查询无效吗?
然后,您可能需要仔细查看user_attrs
dovecot-ldap.conf 中的映射。您在user_attrs
ldap 属性=dovecot 属性。这里可能有些错误,因为 dovecot 不知道名为 vmail 的属性1,2。 看:
http://wiki.dovecot.org/PasswordDatabase#lookupdbs和http://wiki.dovecot.org/PasswordDatabase/ExtraFields