myOmikron / mailcow-ldap-sync

26 stars 2 forks source link

Add Option to only update/add/remove a specific user #13

Closed theoneandonly-vector closed 2 years ago

theoneandonly-vector commented 2 years ago

I would love to sync only a specific user when defined with a parameter.. so I do a full synch the first time but then I would like to update only a newly created or modified user after this.. So I have a central user-management script which can pass the username successfully.. but when I use the:

--override-filter 

it will delete all other users and only keep the one specified in the filter..

myOmikron commented 2 years ago

I don't see the point in adding this option. Just change your current working directory, so that a new sqlite is created.

The script checks for users in its database, so you need multiple databases if you plan on syncing with multiple filters.

theoneandonly-vector commented 2 years ago

every time I do a synch evcen if Nothing changed and I use the "--update-only-on-change-by-ldap" it will still reauthenticate all the users.. that happens automatically becaus I use SSO with sogo.. but it will reset the users view and also deletes his open email-draft.. so this happens each time the users get synched.. I push this currently on each user-change which is just not optimal..

so when I do this dynamically for each user in his own working directory it should work without a problem (not removing any other user)?

is there any unique identifier I could use to be able to sync a user even if his name or email-address changes?

myOmikron commented 2 years ago

That solely depends on the structure of your LDAP. I guess most LDAP admins will make the DN static for that reason.

theoneandonly-vector commented 2 years ago

That solely depends on the structure of your LDAP. I guess most LDAP admins will make the DN static for that reason.

is that so? so I can do an additional usermapping with for example "sambaSID"? if yes how does it know that this is my unique identifier?