Thanks Stephen and Mark for your replies.
I have been able to identify a file in the shunt queue that threw a matching error when I performed mailman qfile on it.
I moved this file out of the queue in the hope that I would then be able to load the held_messages page successfully. Unfortunately I am still seeing a 500 error on loading the page.
I temporarily reenabled debug logging to confirm that the same error was being thrown.
I have run a loop over all remaining files in the shunt queue and all the remaining files can be accessed by mailman qfile without error.
Assuming that file was the cause are there other steps I need to perform in addition to removing the file from the shunt queue directory?
Thank you, Simon.
From: Stephen J. Turnbull <turnbull.stephen.fw@u.tsukuba.ac.jp> Sent: Sunday, 30 August 2020 12:52 To: Simon Handfield <simon.handfield@sl.nsw.gov.au> Cc: mailman-users@mailman3.org <mailman-users@mailman3.org> Subject: [MM3-users] Mailman3 throws 500 error (unicode encode) when loading held messages in Postorius
Simon Handfield via Mailman-users writes:
I have been working through other threads that indicate the same symptom (500 error when loading held_messages for a list).
You want threads that deal with Unicode:
Error reported in log with debug enabled:
Traceback (most recent call last):
And that last call is::
File "/usr/lib/python3.6/email/message.py", line 315, in set_payload payload = payload.encode(charset.output_charset) UnicodeEncodeError: 'ascii' codec can't encode characters in position 8-9: ordinal not in range(128)
It appears that the message is improperly constructed, and either a Content-Type field has a omitted or inappropriate charset parameter, or perhaps the Content-Type field is omitted entirely (ASCII is the default charset).
This is frequently a problem created by spam messages.
The message should be in the shunt queue. You can examine it with the command "mailman qfile /path/to/message_file.pck". Unfortunately it's not clear from the backtrace where in the message this is: it's at the beginning of a part ("position 8-9") or maybe line, but the part could be late in the message.
If it's spam, you can just delete the file (and do whatever else you do about spam, of course). If it's not spam, it would help if you can guess what language and charset are being used in the message, and we can go from there.
If this is unclear, feel free to ask more.
_
[State Library of NSW]<https://www.sl.nsw.gov.au/> Simon Handfield Desktop and Infrastructure Leader simon.handfield@sl.nsw.gov.au<mailto:simon.handfield@sl.nsw.gov.au> +61 2 9273 1535
Macquarie Street, Sydney NSW 2000, Australia www.sl.nsw.gov.au<https://www.sl.nsw.gov.au/>
This message is intended for the addressee named and may contain confidential information. If you are not the intended recipient, please delete it and notify the sender. Views expressed in this message are those of the individual sender, and are not necessarily the views of their organisation.