Skip to content

docs(core.config.auth.databases.ldap): fix LDAP filter config variable#1549

Closed
spaceone wants to merge 1 commit into
dovecot:mainfrom
spaceone:docs/ldap-filter
Closed

docs(core.config.auth.databases.ldap): fix LDAP filter config variable#1549
spaceone wants to merge 1 commit into
dovecot:mainfrom
spaceone:docs/ldap-filter

Conversation

@spaceone
Copy link
Copy Markdown

@spaceone spaceone commented Jun 3, 2026

Hello,
https://doc.dovecot.org/2.4.4/core/config/auth/databases/ldap.html#ldap-userdb

documents two variants to specify the LDAP filter:

userdb ldap {
  filter = (&(objectClass=posixAccount)(uid=%{user}))
  fields {
    home = %{ldap:homeDirectory}
    uid = %{ldap:uidNumber}
    gid = %{ldap:gidNumber}
  }
}
userdb ldap-user {
  driver = ldap
  result_success = continue-ok
  ldap_filter = (&(objectClass=posixAccount)(uid=%{user}))
  fields {
    class = %{ldap:userClass}
  }
}

either as filter or as ldap_filter.
I didn't find the source code, where this is parsed.
But I assume ldap_filter in a userdb/passwd block is wrong. Only the global options are prefixed with ldap_.

@cmouse
Copy link
Copy Markdown
Contributor

cmouse commented Jun 4, 2026

The reason is that the real setting name is passdb_ldap_filter. There is bit of magic parsing here.

passdb ldap {
   filter
}

gets expanded into this by virtue of having passdb and ldap in the block name.

if you have

passdb users {
  driver = ldap
  ldap_filter
}

you need the ldap_ prefix, or you could use passdb_ldap_filter.

@spaceone
Copy link
Copy Markdown
Author

spaceone commented Jun 4, 2026

alright, this is now more logical to me.
Then I close this MR.

@spaceone spaceone closed this Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants