Eu estou tentando configurar um servidor de e-mail no Debian Jessie e me deparei com um problema que está me intrigando.
Ao tentar acessar o OpenLDAP através do saslauthd através do comando
testsaslauthd -u user1 -p user1pw -f /var/spool/postfix/var/run/saslauthd/mux
Eu recebo o seguinte erro no auth.log
Apr 17 10:36:50 debmailserv saslauthd[1661]: user ldap_search_st() failed: Bad search filter
Apr 17 10:36:50 debmailserv saslauthd[1661]: Retrying authentication
Apr 17 10:36:50 debmailserv saslauthd[1661]: user ldap_search_st() failed: Bad search filter
Apr 17 10:36:50 debmailserv saslauthd[1661]: Authentication failed for user1: Retry condition (ldap server connection reset or broken) (-3)
Apr 17 10:36:50 debmailserv saslauthd[1661]: do_auth : auth failure: [user=user1] [service=imap] [realm=] [mech=ldap] [reason=Unknown]
Mas se eu usar o mesmo filtro de pesquisa usado no saslauthd.conf usando o seguinte ldapsearch, ele funcionará bem.
ldapsearch -D "uid=saslauthd,ou=services,dc=example,dc=com" -w saslauthdpw \
-p 389 -h 127.0.0.1 -b "ou=people,dc=example,dc=com" \
-s sub "(&(uid=user1)(mailEnabled=TRUE))"
Meu saslauthd.conf se parece com isso
# Server
ldap_servers: ldap://127.0.0.1/
# Identity
ldap_bind_dn: uid=saslauthd,ou=services,dc=example,dc=com
ldap_bind_pw: saslauthdpw
ldap_auth_method: bind
# Connection
ldap_version: 3
ldap_timeout: 10
ldap_time_limit: 10
ldap_referrals: yes
# Search
ldap_scope: sub
ldap_search_base: ou=people,dc=example,dc=com
ldap_filter: (&(uid=%u)(mailEnabled=TRUE))
# SSL
ldap_ssl: no
ldap_starttls: no
Se eu comentar o ldap_filter, então o testsaslauth funciona bem.
Todos os ponteiros serão muito apreciados!