Hello Guys,
Thank you for the help.
Mark, I followed your recommendation running your code and it's done, problem solved.
Just for curiosity, does anyone know the reasons for this kind of problem and how to avoid it?
Thank you very much.
-- Carlos Adean
On Thu, Feb 9, 2023 at 1:55 AM Mark Sapiro <mark@msapiro.net> wrote:
On 2/8/23 08:34, C. Souza wrote:
I'm trying to manage 2 held messages in a specific list and I'm getting this error below when I click on /held_messages. It never happened before. ... ==> mailmanweb.log <== ERROR 2023-02-08 16:01:30,149 1516 django.request Internal Server Error: /mailman3/lists/mylist.domain.com/held_messages Traceback (most recent call last): ... File
"/opt/mailman/venv/lib64/python3.6/site-packages/django/utils/dateparse.py",
line 107, in parse_datetime match = datetime_re.match(value) TypeError: expected string or bytes-like object
I'm not certain, but it looks like one of the held messages has a bad or possibly missing Date: header. Working around this is tricky. You can do the following in mailman shell.
$ 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 >>> requests = IListRequests(m) >>> msgstor = getUtility(IMessageStore) >>> for request in requests.held_requests: ... key, data = requests.get_request(request.id) ... if data['_request_type'] == 'held_message': ... print(f'request ID = {request.id}Message-ID = {key}\n ' ... f'message = {msgstor.get_message_by_id(key)}') ... This will print for each held message output like request ID = nnn Message-ID = <the message id> message = the message content You can then handle these messages with >>> from mailman.app.moderator import handle_message >>> handle_message(m, nnn, action) where nnn is the request ID and action is either Action.discard to discard the message or Action.accept to accept it. And finally >>> commit()
If you decide you want to edit the message content before accepting it, you could find the message in the file system. One of the headers in the displayed message is something like
Message-ID-Hash: IWL2EUW3FT7IIUA3QYTZEX4W4JBZ26HL
the message is saved as a python pickle in the file system in Mailman's var/messages/ directory. This has subdirectories of the first two characters of the Message-ID-Hash value and those have subdirectories of the second two characters of the Message-ID-Hash value, so if the above were the actual Message-ID-Hash the pickle would be at var/messages/IW/L2/IWL2EUW3FT7IIUA3QYTZEX4W4JBZ26HL. You would need to pickle the new message content and save that over the existing file.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mailman-users mailing list -- mailman-users@mailman3.org To unsubscribe send an email to mailman-users-leave@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/ Archived at: https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message/...
This message sent to skooperit@gmail.com