docker-mailserver: Can't login mail server with ldap
Problem
I can’t login mail server with ldap.
when I run setup.sh email list command it shows ‘test@test.mail’.
but, I exec command dovecot user '*' in mail docker, It show noting.
also, I can’t see anything users at A like following image

Goal
- Can login with rainloop
- Send / Receive mail
- Can change password using by ldap-change-password@rainloop
Tried thing
- Read and follow #1003
- Read doc Configure LDAP at wiki
Images
- mail : mailserver/docker-mailserver:latest
- ldap : jsmitsnl/docker-openldap-postfix-book:latest
- Rainloop : hardware/rainloop:latest
env
- hostname: mail
- domainname: test.mail
- container_name: mail
- ENABLE_SPAMASSASSIN : 1
- ENABLE_CLAMAV : 0
- ENABLE_FAIL2BAN : 1
- ENABLE_POSTGREY : 1
- ENABLE_SASLAUTHD : 1
- SASLAUTHD_LDAP_SERVER : 172.17.0.5 # ldap
- SASLAUTHD_LDAP_BIND_DN : cn=admin,dc=test,dc=mail
- SASLAUTHD_LDAP_PASSWORD : admin
- SASLAUTHD_LDAP_SEARCH_BASE : dc=test,dc=mail
- SASLAUTHD_LDAP_FILTER : (&(mail=%s)(objectClass=person))
- SASLAUTHD_MECHANISMS : ldap
- ENABLE_LDAP : 1
- LDAP_SERVER_HOST : 172.17.0.5 # ldap server
- LDAP_SEARCH_BASE : dc=test.mail
- LDAP_BIND_DN : cn=admin,dc=test,dc=mail
- LDAP_BIND_PW : admin
- LDAP_QUERY_FILTER_USER : (&(objectClass=user)(mail=%s))
- LDAP_QUERY_FILTER_GROUP : (&(objectclass=group)(mail=%s))
- LDAP_QUERY_FILTER_ALIAS : (&(objectClass=user)(otherMailbox=%s))
- LDAP_QUERY_FILTER_DOMAIN : (&(\|(mail=*@%s)(mailalias=*@%s)(mailGroupMember=*@%s))(mailEnabled=TRUE))
- ENABLE_POSTFIX_VIRTUAL_TRANSPORT : 1
- POSTFIX_DAGENT : POSTFIX_DAGENT
- DOVECOT_PASS_FILTER : (&(objectClass=mailAccount)(mail=%n))
- DOVECOT_USER_FILTER : (&(objectClass=mailAccount)(mail=%n))
ldap
- LDAP_ADMIN_PASSWORD : admin
- LDAP_ORGANISATION : mail
- LDAP_DOMAIN : test.mail
- LDAP_LOG_LEVEL : 1
I’m not sure what I do test and look for this issue. Any help or Question will be greatly appreciated and helpful.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 25 (9 by maintainers)
Hello, I’m not really sure what you want to do, but if I understood correctly, you want to create an user : PosixAccount with attribute of PostfixBookMailAccount with PHPLDAPadmin.
You must have already import LDIF file of PostfixBookMail schema.
In this case you need to create an user with PosixAccount first :
After this is done, go to your fresh new user, scroll down to the “objectClass” section and go for add value like this :
Now select your desired value, in my case it’s PostfixBookMailAccount, and in the next window add email to bind to the user
Now you can add all desired attributes to the user in “Add new attributes” section
I hope my answer gonna help you, keep me in touch if you need more help with LDAP
Try to retrieve users with a filter like that :
- LDAP_QUERY_FILTER_USER=(&(objectClass=inetOrgPerson)(mail=%s))I think your issue come up because you added a new index to your system ( PostfixBookMailAccount ) without reindexing it. You can try mostworld77’s solution in this link : https://unix.stackexchange.com/a/463151
From your screenshot it appears you did not configure any users in LDAP.
Please note that this image will not add any users to LDAP directly nor does it allow to manage them directly. You cannot use the setup.sh command, but have to use an LDAP manager (like the one in your screenshot) to manage any users or aliases.
Your configuration should also use values for the LDAP user/group/alias lookup settings that work with the preconfigured LDAP schema of your LDAP image. The default setup here should work just fine if you use the postfix book schema: https://github.com/docker-mailserver/docker-mailserver/blob/master/README.md#examples (scroll down to “LDAP setup”). Try to use those settings and create the users in LDAP according to your schema.