mirror of
https://github.com/lldap/lldap.git
synced 2026-04-25 16:25:55 +03:00
[GH-ISSUE #877] [INTEGRATION] Stalwart Mailserver #319
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#319
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 @dereulenspiegel on GitHub (Mar 21, 2024).
Original GitHub issue: https://github.com/lldap/lldap/issues/877
Checklist
Description of the service
I am currently trying to setup Stalwart Mailserver which is an all in one mailserver solution
What you've tried
I tried setting up lldap as the directory for Stalwart Mailserver so users can authenticate with their existing accounts
What's not working
Users logging in should be working, bit identifying an admin user does not. Unfortunately Stalwart does not support creating a filter for looking up group membership to identitfy admin users. Instead it is looking checking if a user has the
objectClassadminoradministrator.I know that I can add such an objectClass to the schema via lldap-cli, but then unfortunately all users have this objectClass which I do not want.
Currently I am not sure if I miss something in the GraphQL-API and lldap-cli (I am running the version from the 18.04.2024) or if this is a current limitation of lldap.
Thanks in advance :)
@nitnelave commented on GitHub (Mar 21, 2024):
Unfortunately, that's a limitation of LLDAP. It's also fairly unusual to check for object classes to identify admins: object classes are usually tied with attributes (e.g. a "person" has a first name and last name, a "groupOfNames" has a group id and members). Unless they use a specific attribute that admins have but not other users, it's weird to look for an object class.
Anyway, to answer your question: that's not something LLDAP will support. I recommend asking them to implement an admin filter (which can default to checking the object class if they want).
@dereulenspiegel commented on GitHub (Mar 21, 2024):
Thanks for the quick response. I digged deeper through the documentation of stalwart. And it is possible to map the
typeattribute to a custom attribute and fill this with the a string likeadmin. That seems to get me authenticated as the admin user, but I ran into other issues. So it will probably be some time until this integration works, but I will report back.@kri164 commented on GitHub (Apr 12, 2024):
@dereulenspiegel can you show your stalwart-mail's config as a example, please?
@ThatFave commented on GitHub (Aug 19, 2024):
I'd also like to know what you have configured
@nitnelave commented on GitHub (Aug 19, 2024):
Re-opening since we don't have an example config.
@ThatFave commented on GitHub (Nov 26, 2024):
I have a running config:
in lldap, add the following to the user schema:
to a user you want to be able to log in with, add anything to the userpassword field, I used 'test'
in Stalwart config.toml:
I don't know if quota, alias or lists work, will investigate.
@nitnelave commented on GitHub (Nov 26, 2024):
@ThatFave I'm worried about the userPassword field: won't that take precedence over logging in via LDAP ? I don't want to have 2 sources of truth for passwords, especially not if it's a cleartext password.
If Stalwart requires userPassword, I cannot recommend using LLDAP with it.
@ThatFave commented on GitHub (Nov 26, 2024):
I see your concern, but that does not seem to be the case. In my testing, it looks like Stalwart needs a dummy value there when logging in, or else the login fails with
ERROR Authentication error (auth.error) listenerId = "http", localPort = 8080, remoteIp = 10.20.0.101, remotePort = 58325, details = Authentication error (auth.error) { details = Account does not contain secrets, causedBy = crates/common/src/auth/oauth/token.rs:239, causedBy = crates/common/src/auth/oauth/token.rs:53 }, causedBy = crates/jmap/src/auth/oauth/token.rs:123. This does not mean the password which is used to log in is actually the dummy value, rather this should be the reason: https://stalw.art/docs/auth/backend/ldap/#limitations-regarding-password-hashes (?)@nitnelave commented on GitHub (Nov 26, 2024):
I see. Then there's no point in calling it "userPassword", we can call it "stalwartDummySecret", no? Since it's configurable.
@ThatFave commented on GitHub (Nov 26, 2024):
I guess so, I just went with the default.
@choucavalier commented on GitHub (Jan 15, 2025):
@ThatFave thx for sharing your config. it got me further. however it seems that mailAlias does not work. did you manage to get it to work? i think the lookup query needs to be adapted so that an account can be looked up based on the mailAlias. right now it says "account not found"
@nitnelave commented on GitHub (Jan 15, 2025):
@choucavalier a known limitation of LLDAP is that you can't search in attribute lists (or have equality filters). The common workaround for that is to have a fixed number of single value aliases: mailAlias1, mailAlias2 and so on.
Wildcards are also not supported on custom attributes, so no "*@mydomain.com"
@ThatFave commented on GitHub (Jan 15, 2025):
@choucavalier no problem! I did not try to use mailAlias yet, so I don't know. Maybe a workaround is possible, but as @nitnelave put it, I don't think there is an easy way. kind regards
@nitnelave commented on GitHub (Feb 22, 2025):
There's now an example config for stalwart!