3 Feb
2022
3 Feb
'22
4:01 p.m.
Hello all,
we now have at least one mailing list (there may be more affected) that generates a 500 error when calling the held_messages page. After looking at the held messages via the mailman shell, we have identified three mails that have neither a subject nor a message body. How can we remove these three mails from the database?
This is the mailman shell command we used:
mailman shell -l listname@lists.example.com
<removed>
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.
Die Variable 'm' ist die listname@lists.example.com Mailingliste
>>> msg_db = getUtility(IMessageStore)
>>> req_db = IListRequests(m)
>>> reqs = list(req_db.held_requests)
>>> for req in reqs:
... print('{}: {}'.format(req.id, req.request_type))
...
32598: 1
[...]
107656: 1
107737: 1
107758: 1
>>> from mailman.app.moderator import handle_message
>>> handle_message(m, 107758, Action.discard)
>>> reqs = list(req_db.held_requests)
>>> for req in reqs:
... print('{}: {}'.format(req.id, req.request_type))
...
32598: 1
[...]
107656: 1
107737: 1
>>> handle_message(m, 92927, Action.discard)
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/opt/mailman/mailman-venv/lib64/python3.6/site-packages/mailman/app/moderator.py", line 112, in handle_message
key, msgdata = requestdb.get_request(id)
TypeError: 'NoneType' object is not iterable
>>>