Howto discard all pending unsubscription requests in a list?
Hi, a moderator managed to remove almost 2000 members from a list. Luckily unsubscription is set to moderated.
Is there a script to discard all tose requests and get the members back on the list?
I found https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/ thread/UB6HHD4Q2GQ5XSDDXWMKJHTTADXFT46L/#DNV6AU4E3EBS2JUTZQD64GBJM7JHT3WP but this is meant for single request and involves manual finding a token.
My python skills are not existent, so I don't know how to use that for my situation.
Any hints appreciated.
TIA, Andreas
Andreas Vetter writes:
a moderator managed to remove almost 2000 members from a list. Luckily unsubscription is set to moderated.
Is there a script to discard all tose requests
Not that I know of, and I am way too tired to dare hack one up right now. It's early in the day in the US still so you may get a helpful reply before I wake up tomorrow.
and get the members back on the list?
They're still on the list until the unsubscription request is accepted. Just tell your moderators not to approve any unsubscriptions (or to *discard* as many as they have patience for ;-) until further notice.
My python skills are not existent, so I don't know how to use that for my situation.
I don't think the method you found is appropriate any more. You had to go to that much trouble at that time because of a bug. Now it's fixed and the process is much more straightforward, but this is the first time I've looked at that patch and I'm not sure I understand it yet. Hang on a little longer and we'll get you a script.
Steve
-- GNU Mailman consultant (installation, migration, customization) Sirius Open Source https://www.siriusopensource.com/ Software systems consulting in Europe, North America, and Japan
Thank you. You are right, all members are still on the list - about 660. In the meantime I found out that obviously somebody used three times the unsubscribe all button instead of unsubscribe checked. So we arrived at almost 2000 requests. We clicked on discard about 500 times in an hour. So we are down to 1450 requests now.
Interesting finding: When you click fast enough on discard down the column before the page is able to reload, you can get rid of several requests at one time, but the admin gets for every extra click an email with an internal server error. (This is still a venv installation on newest releases, not using newest git)
All the best, Andreas
-------- Ursprüngliche Nachricht -------- Von: "Stephen J. Turnbull" <steve@turnbull.jp> Datum: 19.05.26 17:44 (GMT+01:00) An: Andreas Vetter <andreas.vetter@uni-wuerzburg.de> Cc: Mailman-users <mailman-users@mailman3.org> Betreff: [EXT] [MM3-users] Howto discard all pending unsubscription requests in a list?
Andreas Vetter writes:
a moderator managed to remove almost 2000 members from a list. Luckily unsubscription is set to moderated.
Is there a script to discard all tose requests
Not that I know of, and I am way too tired to dare hack one up right now. It's early in the day in the US still so you may get a helpful reply before I wake up tomorrow.
and get the members back on the list?
They're still on the list until the unsubscription request is accepted. Just tell your moderators not to approve any unsubscriptions (or to *discard* as many as they have patience for ;-) until further notice.
My python skills are not existent, so I don't know how to use that for my situation.
I don't think the method you found is appropriate any more. You had to go to that much trouble at that time because of a bug. Now it's fixed and the process is much more straightforward, but this is the first time I've looked at that patch and I'm not sure I understand it yet. Hang on a little longer and we'll get you a script.
Steve
-- GNU Mailman consultant (installation, migration, customization) Sirius Open Source https://www.siriusopensource.com/ Software systems consulting in Europe, North America, and Japan
On 5/19/26 2:54 AM, Andreas Vetter wrote:
Is there a script to discard all tose requests and get the members back on the list?
A mailman shell interaction like this should do it.
$ mailman shell Welcome to the GNU Mailman shell Use commit() to commit changes. Use abort() to discard changes since the last commit. Exit with ctrl+D does an implicit commit() but exit() does not.
pendings = getUtility(IPendings) for token, data in pendings.find(pend_type='unsubscription'): ... if data and data['list_id'] == 'the_list.example.com': ... pendings.confirm(token, expunge=True) ... commit()
In the above, replace the_list.example.com with the actual list_id (the list posting address with '@' replaced with '.')
If there are no other lists with pending unsubscriptions, you can omit
the and data['list_id'] == 'the_list.example.com' check.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (3)
-
Andreas Vetter -
Mark Sapiro -
Stephen J. Turnbull