@@ -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