Oops. My bad. The reason for the error messages is documented:
passdb_ldap_bind_userdn:
"Note that you can't use any %{ldap:*} variables in passdb_fields if you use this setting, because no LDAP fields are looked up."
RTFM.
https://doc.dovecot.org/main/core/config/auth/databases/ldap.html#passdb_lda...
Am 19.10.26 um 10:59 schrieb Claus-Justus Heine via dovecot:
Mmmh, there seem to be some interesting settings like
result_success = .... skip = ....
but I found it difficult to find documentation for those.
Am 19.10.26 um 10:06 schrieb Claus-Justus Heine via dovecot:
Not so important, but it fills the logs. So first: it works :)
I have such a setup:
passdb ldap { ldap_base = ou=People,dc=example,dc=de bind = yes bind_userdn = uid=%{user|username|lower},ou=People,dc=example,dc=de filter = ... fields { user = %{ldap:uid} ... } }
passdb ldap-roles { driver = ldap ldap_base = ou=Roles,dc=example,dc=de passdb_ldap_bind = yes filter = ... fields { user = %{ldap:uid} ... } }
plus entries for the user-db. Now, what happens is that a user in my case lives either below People or Roles. Then Dovecot searches for the user which does not exist in one of the tow sections and then complains that the attributes (e.g. here uid) do not exist:
2026-10-19T08:47:22.846312+02:00 mail dovecot: auth(john@example.de,78.51.253.51,sasl:plain)<Pf/Y4itelu9OM/0z>: Error : ldap: auth_passdb_post settings: Failed to parse configuration: Failed to expand passdb_fields/user setting variables: lda p: No such attribute 'uid'
This doesn't hurt to much as Dovecot tries all given passdb entries until it succeeds or fails.
Is this perhaps a misconfiguration on my side? Of course, I could rewrite the stuff to use dc=example,dc=de as search base and adjust the filters such that the stuff still yields the correct users. That is: I could live with a single passdb. But it seemed somehow "natural" to generate two distinct passdb entries for real human beings and "roles".
Best
Claus
-- Claus-Justus Heine himself@claus-justus-heine.de http://www.claus-justus-heine.de/
Schatzmeister der Camerata Academica Freiburg e.V. --- www.cafev.de