22 Apr
2022
22 Apr
'22
3:19 a.m.
On 4/21/22 14:56, Chris via Mailman-users wrote:
We had a mail loop on one of our lists and ended up with over 51k messages in pending (held due to post not form a list member)
Trying to delete them from the web UI will take forever, as the largest pagination you can view is 200 at a time.
Tried to delete them from the Python interactive shell, but it looks like the API times out after a while.
Is there another way to delete all these unwanted held posts?
I suggest the following in mailman shell
$ bin/mailman shell -l list.example.com
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.
The variable 'm' is the list.example.com mailing list
>>> from mailman.app.moderator import handle_message
>>> requestdb = IListRequests(m)
>>> for id, type in requestdb.held_requests:
... if type == RequestType.held_message:
... handle_message(m, id, Action.discard)
...
>>> commit()
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan