myOmikron / mailcow-ldap-sync

26 stars 2 forks source link

still overwriting my users, when there's no change #6

Closed theoneandonly-vector closed 2 years ago

theoneandonly-vector commented 2 years ago

I run the command like this:

cd /opt/mailcow-ldap-sync/mailcow_ldap_sync && /opt/mailcow-ldap-sync/venv/bin/python3 ./main.py --update-only-on-change-by-ldap

I get this log, but I'm 100% sure there was no change at all:

INFO:mailcow_ldap_sync:{'username': 'administrator@mydomain.tld', 'active': 1, 'active_int': 1, 'domain': 'mydomain.tld', 'relayhost': None, 'name': 'Administrator Administrator', 'local_part': 'administrator', '>
INFO:mailcow_ldap_sync:{'username': 'administrator@mydomain.tld', 'active': 1, 'active_int': 1, 'domain': 'mydomain.tld', 'relayhost': None, 'name': 'Administrator Administrator', 'local_part': 'administrator', '>
INFO:mailcow_ldap_sync:LDAP user uid=Administrator,cn=users,dc=mydomain,dc=tld was modified in mailcow

additional question.. when this works correctly and not overwrite the users on each run, will it still overwrite them when there is a pw-change form LDAP-side (needed..)?

theoneandonly-vector commented 2 years ago

@myOmikron do you think this is fixable?

myOmikron commented 2 years ago

It surely is, I have currently no spare time to dig into this, but I'll be happy to review and accept Pull Requests

theoneandonly-vector commented 2 years ago

is it possible to use the script somehow with passing a specific address? so I could update specific users on demand

theoneandonly-vector commented 2 years ago

without destroying all web-sessions

myOmikron commented 2 years ago

Implemented with ec1d266534968e8df49ff48bafec6bc881aea5b4

theoneandonly-vector commented 2 years ago

when I start the script without changing the filter to only update a specific user but use " --update-only-on-change-by-ldap" it will still re-authenticate all users on sogo, because there is some change done by the script. It tells me "None" in the terminal when I run it.