Skip to content

OpenLDAP compatibility #15

Description

@netthier

This tool does not seem to support OpenLDAP, since syncer.py relies on the userPrincipalName attribute being present.
This attribute is only available in Microsoft AD, and attempting to use this tool with OpenLDAP results in the following error:

ldap-mailcow    | 19.01.21 16:04:20 Config file conf/dovecot/ldap/passdb.conf unchanged
ldap-mailcow    | 19.01.21 16:04:20 Config file conf/dovecot/extra.conf unchanged
ldap-mailcow    | 19.01.21 16:04:20 Config file conf/sogo/plist_ldap unchanged
ldap-mailcow    | Traceback (most recent call last):
ldap-mailcow    |   File "syncer.py", line 181, in <module>
ldap-mailcow    |     main()
ldap-mailcow    |   File "syncer.py", line 31, in main
ldap-mailcow    |     sync()
ldap-mailcow    |   File "syncer.py", line 52, in sync
ldap-mailcow    |     for (email, ldap_name, ldap_active) in ldap_results:
ldap-mailcow    |   File "syncer.py", line 46, in <lambda>
ldap-mailcow    |     x[1]['userPrincipalName'][0].decode(),
ldap-mailcow    | KeyError: 'userPrincipalName'

To make this compatible with the OpenLDAP "inetOrgPerson", a possible solution would be to make the attributes synced user-configurable.
For example:

LDAP-MAILCOW_LDAP_USER_ATTR=mail # userPrincipalName by default

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions