Programmierus / ldap-mailcow

LDAP account synchronization and authentication for mailcow-dockerized
97 stars 38 forks source link

LDAP login for Admins only #4

Closed lucianlazar1983 closed 4 years ago

lucianlazar1983 commented 4 years ago

Hi there, Any chance this could easily be modified in order to use LDAP authentication only for admins? What i mean is to allow domain admins and mailbox users login just fine using exosting MySQL but enable LDAP only for server admins. Thanks!

Programmierus commented 4 years ago

The tool itself does not restrict mysql (or any other) authentication methods allowing them to work simultaneously. All you have to do is to adjust the filter on line 42 here, restricting the sync to the group you need (admins in your case).

It's planned to allow LDAP Filter configuration through environmental variable, but I still can't find an hour to finish it.

lucianlazar1983 commented 4 years ago

Thank you for your fast reply, will try that because i only need my collegagues to access and manage the whole server via LDAP (We use FreeIPA) but not get in the way of how domains are managed. Will try your tip and get back if it works. Thanks

Programmierus commented 4 years ago

I have implemented LDAP_FILTER in last commit (507dd95), new README.md has some hints how you can restrict LDAP sync to a certain group only.