On 3/30/22 04:30, kenneth.karlsson@eco.cept.org wrote:
The command: EHLO contoso.com mail from: <xxx@xxx.com> rcpt to: <mhtest@list.cept.org> DATA This is a test message .
Some headers in the message might be nice.
Accepted by Postfix: Mar 29 11:17:17 lits01a postfix/smtpd[4088]: B86DD6A04B9: client=unknown[192.168.200.157] Mar 29 11:17:30 lits01a postfix/cleanup[4091]: B86DD6A04B9: message-id=<>
In my case, Postfix adds a Message-ID: header and logs it here.
Mar 29 11:17:30 lits01a postfix/qmgr[3952]: B86DD6A04B9: from=<xxx@xxx.com>, size=200, nrcpt=1 (queue active) Mar 29 11:17:30 lits01a postfix/lmtp[4109]: B86DD6A04B9: to=<mhtest@list.cept.org>, relay=127.0.0.1[127.0.0.1]:8024, delay=24, delays=24/0.01/0/0.01, dsn=2.0.0, status=sent (250 Ok) Mar 29 11:17:30 lits01a postfix/qmgr[3952]: B86DD6A04B9: removed
MM receives it: Mar 29 11:17:30 2022 (3940) ('127.0.0.1', 37146) handling connection Mar 29 11:17:30 2022 (3940) ('127.0.0.1', 37146) Data: b'LHLO list.cept.org' Mar 29 11:17:30 2022 (3940) ('127.0.0.1', 37146) Data: b'MAIL FROM:<xxx@xxx.com>' Mar 29 11:17:30 2022 (3940) ('127.0.0.1', 37146) sender: xxx@xxx.com Mar 29 11:17:30 2022 (3940) ('127.0.0.1', 37146) Data: b'RCPT TO:<mhtest@list.cept.org>' Mar 29 11:17:30 2022 (3940) ('127.0.0.1', 37146) recip: mhtest@list.cept.org Mar 29 11:17:30 2022 (3940) ('127.0.0.1', 37146) Data: b'DATA' Mar 29 11:17:30 2022 (3940) ('127.0.0.1', 37146) Data: b'QUIT' Mar 29 11:17:30 2022 (3940) ('127.0.0.1', 37146) connection lost Mar 29 11:17:30 2022 (3940) Connection lost during _handle_client()
These log messages come from aiosmtpd which is used by mailman/runners/lmtp.py to implement Mailman's LMTP server. Clearly, aiosmtpd sees the envelope sender as xxx@xxx.com, but
But MM3 discards it: Mar 29 10:08:03 2022 (1767) DISCARD: <164854848338.1768.3954079936807939297@lits01a>; ['The message has no valid senders']
This is because Mailman's NoSenders rule gets an empty response from the
messages sender
method. This means there is no address in any of the
messages From:, Reply-To: or Sender: headers which is expected, but it
also says that the message's get_unixfrom() method didn't return an
address as this is checked between From: and Reply-To:.
I tried a similar test, but in my case, Postfix (3.4.13) added Message-Id:, Date: and From: headers, so that wasn't definitive, but I then added logging to the LMTP runner at https://gitlab.com/mailman/mailman/-/blob/master/src/mailman/runners/lmtp.py... to log the unixfrom and the message and the message did have a unixfrom as added by the LMTP runner, so even without the Postfix added header, it had a sender.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan