On 9/15/22 12:09, Mark Sapiro wrote:
This apparently confuses the Python email package so that the get_payload() method returns a list of strings rather than a list of message objects.
Actually, that's not correct. The get_payload() method is returning a list of message objects. It only appears to be a list of strings because this is a mailman.email.message.Message object whose __repr__() method returns the content as a string.
The real issue is the missing Content-Type: header which implies the content is text/plain.
What I think is happening is the original message is parsed into a multipart/alternative Message object with payload of the text/plain and text/html subparts. Then something deletes the top level Content-Type: header which makes the message appear to be text/plain, yet get_payload() still returns the list of two subparts.
So the real issue is what's removing all those headers from the anonymized message. I think there must be some issue with the configured anonymous_list_keep_headers or the code in mailman/handlers/cleanse.py is somehow corrupted.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan