![为 Dovecot 电子邮件服务器创建具有特定属性的 LDAP 目录用户](https://linux22.com/image/650318/%E4%B8%BA%20Dovecot%20%E7%94%B5%E5%AD%90%E9%82%AE%E4%BB%B6%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%88%9B%E5%BB%BA%E5%85%B7%E6%9C%89%E7%89%B9%E5%AE%9A%E5%B1%9E%E6%80%A7%E7%9A%84%20LDAP%20%E7%9B%AE%E5%BD%95%E7%94%A8%E6%88%B7.png)
我的 CentOS 6.4 版(最终版)机器上安装了 openldap-2.4.39-8.el6.x86_64。我在另一台机器上安装了 dovecot,我想为我的 dovecot 邮件用户执行 ldap 身份验证。这是我的 ldapsearch 结果目前的样子:
dn: dc=mailtest,dc=example,dc=net
objectClass: top
objectClass: dcObject
objectClass: organization
o: Test-Dovecot Lab, Inc.
dc: mailtest
dn: ou=People,dc=mailtest,dc=example,dc=net
objectClass: organizationalUnit
ou: People
这是我配置 dovecot-ldap.conf.ext 文件的方式:
user_attrs = \
=user=%{ldap:mailRoutingAddress}, \
=quota_rule=*:storage=%{ldap:messageQuotaHard}k
user_filter = (mailRoutingAddress=%u)
pass_attrs = \
=user=%{ldap:mailRoutingAddress}, \
=password=%{ldap:userPassword}, \
=userdb_quota_rule=*:storage=%{ldap:messageQuotaHard}k
pass_filter = (mailRoutingAddress=%u)
iterate_attrs = mailRoutingAddress=user
iterate_filter = (objectClass=messageStoreRecipient)
如果可能的话,我想将用户添加到 ldap 目录中并包含以下属性:
mailRoutingAddress
userPassword
mailRoutingHost or mailHost
messageQuotaHard
有人可以帮我做到这一点吗?