dovecot.conf
!include_try /usr/share/dovecot/protocols.d/*.protocol
protocols = imap pop3
listen = *, ::
base_dir = /var/run/dovecot/
login_greeting = Dovecot ready.
shutdown_clients = yes
doveadm_socket_path = doveadm-server
dict {
}
!include conf.d/*.conf
10-auth.conf
disable_plaintext_auth = no
auth_mechanisms = plain login
!include auth-ldap.conf.ext
10-mail.conf
mail_location = maildir:/var/spool/mail/example.org.ru/%n
mail_uid = 5000
mail_gid = 5000
mail_privileged_group = mail
valid_chroot_dirs = /var/spool/mail/
10-master.conf
service imap-login {
inet_listener imap {
}
inet_listener imaps {
}
}
service pop3-login {
inet_listener pop3 {
}
inet_listener pop3s {
}
}
service lmtp {
unix_listener lmtp {
}
}
service imap {
}
service pop3 {
}
service auth {
unix_listener /var/spool/postfix/private/auth {
mode = 0666
}
user = postfix
group = postfix
}
service auth-worker {
}
service dict {
unix_listener dict {
}
}
auth-ldap.conf.ext
passdb {
driver = ldap
args = /etc/dovecot/dovecot-ldap.conf.ext
}
userdb {
driver = ldap
args = /etc/dovecot/dovecot-ldap.conf.ext
}
dovecot-ldap.conf.ext
hosts = 192.168.111.128
auth_bind = yes
ldap_version = 3
base = dc=example,dc=org,dc=ru
dn = cn=mailadmin,dc=example,dc=org,dc=ru
dnpass = Password1
deref = never
scope = subtree
user_filter = (&(userPrincipalName=%u)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))
pass_filter = (&(userPrincipalName=%u)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))
Делаю:
# telnet 127.0.0.1 110
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
+OK Dovecot ready.
user mailadmin@example.org.ru
+OK
pass Password1
-ERR [IN-USE] Temporary authentication failure.
Лог:
auth: Error: ldap(mailadmin@example.org.ru,127.0.0.1):/
ldap_search((&(userPrincipalName=mailadmin@example.org.ru)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))) failed: Operations error
Проверяю вот так:
ldapsearch -h 192.168.111.128 -b 'dc=example,dc=org,dc=ru' -D 'cn=mailadmin,dc=example,dc=org,dc=ru' -W -x '(&
(userPrincipalName=test1@example.org.ru)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))'
работает
Postfix работает, письма в ящике mailadmin есть.