mirror of
https://github.com/lldap/lldap.git
synced 2026-04-25 08:15:52 +03:00
[GH-ISSUE #858] [BUG] Search for custom list attribute fails #308
Labels
No labels
backend
blocked
bug
cleanup
dependencies
docker
documentation
duplicate
enhancement
enhancement
frontend
github_actions
good first issue
help wanted
help wanted
integration
invalid
ldap
pull-request
question
rust
rust
tests
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/lldap-lldap#308
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ghtyrant on GitHub (Mar 9, 2024).
Original GitHub issue: https://github.com/lldap/lldap/issues/858
Describe the bug
I have defined a custom list attribute (
mailAlias) on my user schema using lldap-cli:It has some values in it:
When I try to search for a user with a certain mailAlias, the search returns nothing:
Expected behavior
I expect
ldapsearchto returnmyuser. I'm trying to use this in Postfix, so I can define multiple mail aliases per user.Logs
I am using
lldap:latestvia Docker.@ghtyrant commented on GitHub (Mar 10, 2024):
After some digging I guess this is related to https://github.com/lldap/lldap/issues/763, with the conclusion that this is simply unsupported.
Is there any way to implement something like mail alias lookup any other ways? Postfix is the last service I'd have to migrate to LLDAP to finally get rid of OpenLDAP.
@nitnelave commented on GitHub (Mar 10, 2024):
I don't think this is #763, you're not doing a substring query but an equality query, which should be supported.
This looks like a genuine bug, and I'm suspicious of the serialized representation. I'll need to have a look.
@ghtyrant commented on GitHub (Mar 11, 2024):
Happy to hear that it's "just" a bug 😊 Let me know if I can help in any way.
@nitnelave commented on GitHub (Mar 12, 2024):
oh, nevermind, I thought it was about an attribute substring... No, in this case it is about issue #763 and it's not supported. I don't know how postfix is configured, and how many aliases you have per user, but it could be doable to implement the list "by hand" by adding lots of attributes: mailAlias1, mailAlias2, etc... Then the filter would become
(|(mailAlias1={email})(mailAlias2={email})...)Would that work for you? I know it's not ideal, but that's a workaround that would work now.
@jakob42 commented on GitHub (Mar 12, 2024):
I'm also interested in using lldap with postfix after release. I'll try to cook something up with maybe semicolon delimited lists of emails in a single string... 🤔
@ghtyrant commented on GitHub (Mar 12, 2024):
Too bad 😞
Your workaround works, of course. Thanks!
@CluelessTechnologist commented on GitHub (Aug 17, 2024):
I'm glad I found this issue, I thought I was going insane when mailalias stopped working as soon as I added more than one alias to it.
I'm using Docker-mailserver with @nitnelave's workaround and it's working fine. Since it's for personal use I don't have much use for more than 10+ mail aliases anyway.
My schema config:
My mailserver config:
Of course it would be nice if lldap supported multiple values in the mailalias field, but from reading https://github.com/lldap/lldap/issues/763, I gather it would be too complex to implement and go against the purpose of the project, a light LDAP implementation.
@fracklaus commented on GitHub (Mar 9, 2025):
First of all, thank you for developing lldap, which is the best solution I have found to easily manage an ldap server.
However, I also came across this issue when trying to setup my mail server with lldap.
The workaround with multiple alias fields works only partially for me:
This means that next to mailalias01 to mailalias10 fields, I also have to enter the aliases in a multi-value field for nextcloud. Since I now have to enter the data twice, the process is cumbersome and errorprone.
@nitnelave Do you have any ideas how this could be solved? When searching in multi-valued fields will not be supported, can we e.g. have an option that a read-only multi-valued field is propagated from multiple sigle-valued fields automatically? E.g, mailAlias = [ mailAlias01, mailAliad02, ..., mailAlias10 ]?
@nitnelave commented on GitHub (Mar 9, 2025):
Well, there are 2 solutions to the problem: the canonical one is actually supporting multi value fields. There's a design proposal for that, but it's a non trivial amount of tricky work and no one to do that right now.
Thankfully, your other idea (to distribute multi-value fields into single-value ones) is going to be feasible soon-ish (weeks, maybe a few months). There's ongoing work to provide a plugin API, and then you can write a simple Lua plugin that would listen to modifications to the multi-value field and distribute that to the single-value ones.