1 Apr
2022
1 Apr
'22
10:42 a.m.
Hello,
Since a few days we get an error response from our automated membership script.
We use the following code to control the membership for some lists:
def mailinglist_manage(list_address, members):
"""
make sure all 'members' are present on the list and no remove
everyone else
list_address : mail address of mailing list to manage
addresses : mail address that are supposed to be on the list
"""
print("[*] update subscriptions for {}".format(list_address))
ml = mmc.get_list(list_address)
# make sure we dont spam users
ml.settings['send_welcome_message'] = False
ml.settings.save()
addresses = set(members.keys())
ml_members = ml.members
ml_addresses = set((x.address.__str__() for x in ml_members))
for addr in ml_addresses - addresses:
print("unsubscribe {} from {}".format(addr, list_address))
ml.unsubscribe(addr)
for addr in addresses - ml_addresses:
print("subscribe {} to {}".format(addr, list_address))
ml.subscribe(addr, members[addr],
pre_verified=True, pre_confirmed=True,
pre_approved=True)
Since Tuesday without any update performed by us we get the following error from the script when it's running:
Traceback (most recent call last):
File "./mail_user_control.py", line 423, in <module>
mailinglist_manage("XXX@EXAMPLE.COM", members)
File "./mail_user_control.py", line 412, in mailinglist_manage
pre_verified=True, pre_confirmed=True, pre_approved=True)
File
"/root/.local/lib/python3.6/site-packages/mailmanclient/restobjects/mailinglist.py",
line 339, in subscribe
response, content = self._connection.call('members', data)
File
"/root/.local/lib/python3.6/site-packages/mailmanclient/restbase/connection.py",
line 112, in call
error_msg, response, None)
urllib.error.HTTPError: HTTP Error 400: Invalid Parameter "subscriber":
.
If you have an idea why that code now returns this. I would be thankful.
regards
Jacob Sievert