Mark Sapiro wrote:
On 4/26/21 2:00 AM, Andrew Hodgson wrote:
Yep there is a problem with an imported mbox which seems to be present somewhere in the archive on all the lists which I imported using that method. Here is a recent trace from the download option:
[...]
Thanks for the traceback. The issue appears to be with folded headers that should either be unfolded before storing in HyperKitty's database or upon retrieval for this process. This is probably because of outlook.com folding Message-ID: headers. See https://gitlab.com/mailman/mailman/-/issues/844 for one manifestation of this.
I think if you replace the
msg["Message-ID"] = "<%s>" % self.message_id ``` line at 178 in /opt/mailman/venv/lib/python3.7/site-packages/hyperkitty/models/email.py with
msg["Message-ID"] = "<%s>" % self.message_id.strip(' <>\r\n') ``` it will avoid this issue.
I tried this but get the same error, hope I did the modification correctly.
[2021-04-30 19:56:31 +0000] [22104] [ERROR] Error handling request Traceback (most recent call last): File "/opt/mailman/venv/lib/python3.7/site-packages/gunicorn/workers/sync.py", line 180, in handle_request for item in respiter: File "/opt/mailman/venv/lib/python3.7/site-packages/hyperkitty/views/mlist.py", line 335, in stream_mbox msg = email.as_message() File "/opt/mailman/venv/lib/python3.7/site-packages/hyperkitty/models/email.py", line 178, in as_message msg["Message-ID"] = "<%s>" % self.message_id.strip(' <>\r\n') File "/usr/lib/python3.7/email/message.py", line 409, in __setitem__ self._headers.append(self.policy.header_store_parse(name, val)) File "/usr/lib/python3.7/email/policy.py", line 145, in header_store_parse raise ValueError("Header values may not contain linefeed " ValueError: Header values may not contain linefeed or carriage return characters
Thanks. Andrew.