On 6/5/23 14:59, Peter Münster wrote:
On Mon, Jun 05 2023, Mark Sapiro wrote:
Basically, all over.
Thanks. I would like to find out, which function is responsible for the modification of the body, before filling a bug report. Unfortunately I don't have any experience with Python, so any help is highly appreciated. My idea is to add "print(message)" at the places, that you mentioned. Where would I find the output then?
You don't want to use print statements. All those modules do logging to various logs so they pretty much all import logging. Then you add something like
dlog = logging.getLogger('mailman.debug')
near the beginning of the module and then add things like
dlog.info(msg.as_bytes())
to write the message to debug.log.
However, I would not proceed in that way. I would start by putting the
raw problem message as it comes to mailman in a file
and then use mailman shell
do to things like
>>> import email
>>> import smtplib
>>> from mailman.email.message import Message
>>> with open('path/to/message/file', 'rb') as fp:
... msg = email.message_from_binary_file(fp, Message)
...
>>>
to create the message object, and then do something like
>>> conn = smtplib.SMTP()
>>> conn.sendmail(from_addr, to_addrs, msg)
to send the message to to_address and see if it has the added lines. Or maybe just
>>> print(msg.as_bytes())
to see if that has the added lines. It may be necessary to do things like
>>> msg['Message-ID-Hash'] = 'aaaaa'
to add a header to create the issue.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan