LDAPAccountManager / lam

LDAP Account Manager
https://www.ldap-account-manager.org
Other
429 stars 69 forks source link

Error while trying to create mail alias #291

Closed Thor-x86 closed 8 months ago

Thor-x86 commented 8 months ago

Hello maintainers, currently I tried to integrate mail server and Nextcloud with LDAP. Everything is working except mail aliases. When I added a new mail alias entry, LAM throws this error:

Was unable to create DN: cn=customer_service,ou=mailbox,dc=sentilpeler,dc=id. LDAP error, server says: Invalid syntax - objectClass: value #0 invalid per syntax

I confuse, what makes it invalid syntax? This is what I did:

  1. Spin up OpenLDAP from Bitnami with docker, the package is bitnami/openldap
  2. Configure LAM docker container to run alongside with Bitnami's OpenLDAP, it worked and I can create Users and Groups
  3. Go to "LAM Configuration" link at top-right corner of the very first LAM page
  4. Go to "edit server profiles" then login
  5. Add "nisMailAliasUsers" to "Users" module
  6. Add "Mail Aliases" module then put "nisMailAliases" into it
  7. Save the server profile
  8. Login at the main login page
  9. Go to "Accounts" at top-right corner of the page, then open "Mail Aliases", click "New Aliases"
  10. I filled the form as below:
    Alias name: customer_service
    New recipient: thorx86
                   saliva
                   kentut
  11. Hit "save" button, then the error message above shown

Please note that the error still same even though the New recipient emptied

gruberroland commented 8 months ago

This can be caused by a missing schema definition on LDAP server side. Try Tools -> Tests -> Schema test inside LAM to check if your LDAP server supports the required object classes and attributes. If the test is not successful then you need to activate the corresponding schema definitions.

Thor-x86 commented 8 months ago

I got technical difficulty with the ISP and having a hard time re-pulling the image, please keep this issue open while I'm trying to workaround with mobile carrier. Thanks

Thor-x86 commented 8 months ago

Finally, I found the reason why rfc822MailMember and nisMailAlias are missing in OpenLDAP server. Those schemas are stored in misc.schema by default and categorized as experimental. For Bitnami's OpenLDAP, what I have to do is adding these lines into environment of compose.yaml file:

LDAP_ADD_SCHEMAS = yes
LDAP_EXTRA_SCHEMAS = cosine,inetorgperson,nis,misc

Then the mail alias can be added as expected