New install - The Message have no valid senders
I have installed a brand spanking new Ubuntu 21.10, with postfix as SMTP server and mailman3-full apt package.. All checks out fine except when i deliver mails into MM.
Mailman Core Version GNU Mailman 3.3.3 (Tom Sawyer) Mailman Core API Version 3.1 Mailman Core Python Version 3.9.7 (default, Sep 10 2021, 14:59:43) [GCC 11.2.0]
I have a very simple mail command going into Postfix, and it receives it fine and relay it to MM (email address obscured below but of course a proper email address was used !):
The command: EHLO contoso.com mail from: <xxx@xxx.com> rcpt to: <mhtest@list.cept.org> DATA This is a test message .
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=<> 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()
But MM3 discards it: Mar 29 10:08:03 2022 (1767) DISCARD: <164854848338.1768.3954079936807939297@lits01a>; ['The message has no valid senders']
I have no idea where its goes wrong, but fear its something in the source code.
Kind regards Kenneth Karlsson
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
I found a solution, i inserted
always_add_missing_headers = yes
in main.cf of postfix. That seems to make the mail go through. I still dont get why it failed as the From: field was there.
Thanks for reply , it pointed me in a direction.
Kenneth
On 3/31/22 00:44, kenneth.karlsson@eco.cept.org wrote:
I found a solution, i inserted
always_add_missing_headers = yes
in main.cf of postfix. That seems to make the mail go through. I still dont get why it failed as the From: field was there.
There was no From: header in your example. There was an envelope from,
aka envelope sender, aka unixfrom, so it should not have failed. The
mystery here is why the code at
https://gitlab.com/mailman/mailman/-/blob/master/src/mailman/runners/lmtp.py...
apparently failed to set the MAIL FROM:
value.
However, I think it's all moot because your test sent a message without any headers. A real post would probably have a From: header.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (2)
-
kenneth.karlsson@eco.cept.org
-
Mark Sapiro