Skip to content

Commit 12e8344

Browse files
committed
add dontdelete to parameters, list address <> fqdn
1 parent 030418b commit 12e8344

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ services:
2020
- LDAP_PASSWORD=${LDAP_PASSWORD}
2121
- LDAP_HOSTNAME=${LDAP_HOSTNAME}
2222
- MM3SYNC_PREFERRED_LANGUAGE=${MM3SYNC_PREFERRED_LANGUAGE:-de}
23+
- MM3SYNC_DELETE_REST_LIST=${MM3SYNC_DELETE_REST_LIST:-false}
24+
- MM3SYNC_DONT_DELETE=${MM3SYNC_DONT_DELETE}
2325
networks:
2426
services:
2527
ipv4_address: ${MM3SYNC_IP}

m3_sync.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def main(self):
171171
# find group
172172
ret_attr = [
173173
self.sync['group_name_attr'], self.sync['subscriber_attr'],
174-
self.sync['owner_attr'], self.sync['moderator_attr'], "cn", "description"
174+
self.sync['owner_attr'], self.sync['moderator_attr'], "cn", "description", self.sync['mail_attr']
175175
]
176176
search_result = self.ldap.search(
177177
self.sync['search_base'],
@@ -241,7 +241,8 @@ def main(self):
241241
self.logger.info("Create list {0} in domain {1}".format(
242242
list_name, self.sync['default_list_domain']))
243243
try:
244-
mlist = domain.create_list(list_name)
244+
# create list by listname or by email address
245+
mlist = domain.create_list(len(str(datas['mail']))>0 ? datas['mail'] : list_name)
245246
self.set_settings(mlist)
246247
except HTTPError as e:
247248
print(e)
@@ -252,7 +253,7 @@ def main(self):
252253
self.logger.warn("Failed to add list {0}".format(list_name))
253254
continue
254255

255-
mlist_name = mlist.fqdn_listname
256+
mlist_name = mlist.fqdn_listname # important to use this and not the list name
256257

257258
# add domain as accepted non-member
258259
if '@' in self.sync['accept_nonmembers'] :
@@ -316,8 +317,8 @@ def main(self):
316317
if list_name not in ldap_data.keys():
317318

318319
if self.sync['delete_rest_list'] == 'true':
319-
320-
320+
if os.environ.get('DEBUG_DEVELOP') == 'true':
321+
pdb.set_trace()
321322
# some are excluded using regex pattern
322323
if self.sync['exclude_list_re'] and re.search(r'{0}'.format(self.sync['exclude_list_re']), mlist.list_name):
323324
continue

0 commit comments

Comments
 (0)