Using 2 LDAP sources for passdb

Tom via dovecot <[email protected]> Tue, 2 Jun 2026 09:21:51 -0400
Newsgroups gmane.mail.imap.dovecot
Message-ID <[email protected]>
I can't seem to find documentation that shows how to set up 2 LDAP passdb blocks. I can get each of them working properly, but only the second of the two works at any given time. I can't figure out the syntax needed to get both to work, even though I've been all over the Dovecot 2.4x official documentation. The docs seem to suggest settings that the server rejects.

Anyone have any experience doing this, or know the correct syntax? Thanks in advance!

passdb ldap { # works when standalone; fails when combined with 2nd block below
  #passdb_name = ldap1
  #driver = ldap
  ldap_version = 3 
  bind = yes 
  bind_userdn = %{user|username}
  ldap_auth_dn = cn=dovecot,ou=apps,dc=example,dc=com
  ldap_auth_dn_password = D0vec0t
  ldap_base = ou=apps,dc=foscore,dc=com
  ldap_uris = ldapi://%2Frun%2Fldapi
  filter = (&(objectClass=applicationProcess)(cn=%{user}))
  passdb_ldap_bind = yes 
  passdb_ldap_bind_userdn = cn=%{user},ou=apps,dc=example,dc=com
  result_success = return-ok
}
passdb ldap {
  #driver = ldap
  #name = ldap_users
  ldap_version = 3 
  bind = yes 
  bind_userdn = %{user|username}
  ldap_auth_dn = cn=dovecot,ou=apps,dc=example,dc=com
  ldap_auth_dn_password = D0vec0t
  ldap_base = ou=people,dc=example,dc=com
  ldap_uris = ldapi://%2Frun%2Fldapi
  filter = (&(objectClass=posixAccount)(uid=%{user|username})(memberOf=cn=mail,ou=%{user|domain},ou=groups,dc=example,dc=com))
  passdb_ldap_bind = yes 
  passdb_ldap_bind_userdn = uid=%{user|username},ou=people,dc=example,dc=com
  result_success = return-ok
}


_______________________________________________
dovecot mailing list -- [email protected]
To unsubscribe send an email to [email protected]