Dovecot и AD
Всем доброго дня! Голову сломал. Есть postfix 2.11 + dovecot 2.0.20 + mysql на centos 6.5 и есть ActiveDirectory на windows server 2003. Появилась необходимость интеграции всего этого хозяйства с AD. Просто напросто юзеров очень много, и я понимаю что создавать столько почтовых ящиков дело мутарное, а потом еще и пароли для пользователей раздавать. Только сразу с гугл или поиск не посылайте, перерыл кучу всего. Не получается заставить Dovecot авторизовываться. Едиственное уточнение. Домен AD - corp.contoso.com, почтовый сервер mail.local.lan и почтовый домен соответственно local.lan
Вот конфиги.
main.cf
soft_bounce = no
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
default_privs = nobody
inet_interfaces = all
myhostname = mail.local.lan
mydomain = local.lan
myorigin = $mydomain
mydestination = $myhostname,localhost.$myhostname,localhost
#local_recipient_maps = $virtual_mailbox_maps, $virtual_alias_maps
local_recipient_maps = proxy:unix:passwd.byname $alias_maps
unknown_local_recipient_reject_code = 550
mynetworks = 127.0.0.0/8
relay_domains =
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mail_spool_directory = /var/mail
smtpd_banner = $myhostname ESMTP ready
recipient_delimiter = +
debug_peer_level = 2
debug_peer_list = 127.0.0.1
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail
mailq_path = /usr/bin/mailq
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/local/man
config_directory = /etc/postfix
virtual_mailbox_domains = $mydomain
virtual_mailbox_base = /var/vmail
virtual_mailbox_maps = ldap:$config_directory/virtual_mailbox_maps.conf
virtual_alias_maps = ldap:$config_directory/virtual_alias.conf, ldap:$config_directory/virtual_mlist.conf
virtual_minimum_uid = 1150
virtual_uid_maps = static:1150
virtual_gid_maps = static:12
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1
#------------------------------TSL----------------------------------
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous, noplaintext
smtpd_sasl_tls_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth-client
#------------------------------TSL_END------------------------------
virtual_mailbox_maps.conf
server_host = 10.2.0.105:3268
search_base = DC=corp,DC=contoso,DC=com
version = 3
scope = sub
query_filter = (&(objectClass=person)(mail=%s))
result_attribute = mail
result_format = %s/
bind = yes
bind_dn = CN=ldap_user,CN=Users,DC=corp,DC=contoso,DC=com
bind_pw = qwer1234++
start_tls = no
cache = no
Выполняю
postmap -q "user@local.lan" ldap:/etc/postfix/virtual_mailbox_maps.cf
user@local.lan/
dovecot-ldap.conf
hosts = 10.2.0.105:3268
dn = ldap_user@corp.contoso.com
dnpass = qwer1234++
auth_bind = yes
#auth_bind_userdn = %Lu
ldap_version = 3
base = DC=corp,DC=contoso,DC=com
deref = finding
scope = subtree
user_filter = (&(objectClass=person)(mail=%u))
#user_attrs =
pass_filter = (&(objectClass=person)(mail=%u))
pass_attrs = uid=mail, userPassword=password
[root@mail dovecot]# telnet localhost pop3
Trying ::1...
Connected to localhost.
Escape character is '^]'.
+OK Dovecot ready.
user ldap_user
+OK
pass qwer1234++
-ERR Authentication failed.
May 15 16:19:23 auth: Info: ldap(ldap_user,::1): unknown user
May 15 16:20:06 pop3-login: Info: Aborted login (auth failed, 1 attempts): user=<ldap_user>, method=PLAIN, rip=::1, lip=::1, secured
May 15 16:18:56 auth: Debug: Loading modules from directory: /usr/lib64/dovecot/auth
May 15 16:18:56 auth: Debug: Module loaded: /usr/lib64/dovecot/auth/libauthdb_ldap.so
May 15 16:18:56 auth: Debug: Module loaded: /usr/lib64/dovecot/auth/libdriver_sqlite.so
May 15 16:18:56 auth: Debug: Module loaded: /usr/lib64/dovecot/auth/libmech_gssapi.so
May 15 16:18:56 auth: Debug: auth client connected (pid=1930)
May 15 16:19:23 auth: Debug: client in: AUTH 1 PLAIN service=pop3 secured lip=::1 rip=::1 lport=110 rport=44939 resp=AGxkYXBfdXNlcgBxd2VyMTIzNCsr
May 15 16:19:23 auth: Debug: ldap(ldap_user,::1): bind search: base=DC=corp,DC=contoso,DC=com filter=(&(objectClass=person)(mail=ldap_user))
May 15 16:19:25 auth: Debug: client out: FAIL 1 user=ldap_user
Помогите подружить Dovecot с AD.