Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] delivery status notifications should not get BROKEN_HEADERS #3983

Closed
kasak87 opened this issue Nov 18, 2021 · 8 comments
Closed

[BUG] delivery status notifications should not get BROKEN_HEADERS #3983

kasak87 opened this issue Nov 18, 2021 · 8 comments

Comments

@kasak87
Copy link

kasak87 commented Nov 18, 2021

Describe the bug
When normal delivery status notifications is cheked, they always get BROKEN_HEADERS symbol, because of empty "mail from" in envelope.

Steps to Reproduce

  1. Use default rspamd config.
  2. Just wait for any delivery status notification.

Expected behavior
Empty "mail from" header is not "broken", sometimes it should be empty.

DSNs should have empty "mail from" as described in RFC3464 https://datatracker.ietf.org/doc/html/rfc3464

The envelope sender address of the DSN SHOULD be chosen to ensure that no delivery status reports will be issued in response to the DSN itself, and MUST be chosen so that DSNs will not generate mail loops. Whenever an SMTP transaction is used to send a DSN, the MAIL FROM command MUST use a NULL return address, i.e., "MAIL FROM:<>".

Versions

Rspamd daemon version 3.0 from OpenBSD 7.0 packages.
Same behavior were in 2.7 from OpenBSD 6.9

@kasak87 kasak87 added the bug label Nov 18, 2021
@vstakhov
Copy link
Member

The standard explains envelope from and not the From header. From header must be valid in all cases. From the same RFC:

The From field of the message header of the DSN SHOULD contain the
   address of a human who is responsible for maintaining the mail system
   at the Reporting MTA site (e.g., Postmaster), so that a reply to the
   DSN will reach that person. 

So there is nothing to fix on Rspamd side.

@kasak87
Copy link
Author

kasak87 commented Nov 18, 2021

The standard explains envelope from and not the From header. From header must be valid in all cases. From the same RFC:

The From field of the message header of the DSN SHOULD contain the
   address of a human who is responsible for maintaining the mail system
   at the Reporting MTA site (e.g., Postmaster), so that a reply to the
   DSN will reach that person. 

So there is nothing to fix on Rspamd side.

exactly! Here is sample message with filled "From" and empty "mail from"

Return-Path: <>
Received: from mail.tvema.ru (LHLO mail.tvema.ru) (212.233.112.11) by
mail.tvema.ru with LMTP; Thu, 18 Nov 2021 15:20:36 +0300 (MSK)
Received: from localhost (localhost [127.0.0.1])
by mail.tvema.ru (Postfix) with ESMTP id 5A1CD426358D
for fedorova@tvema.ru; Thu, 18 Nov 2021 15:20:36 +0300 (MSK)
Received: from mail.tvema.ru ([127.0.0.1])
by localhost (mail.tvema.ru [127.0.0.1]) (amavisd-new, port 10026)
with ESMTP id gC8Pb9Z2IuhW for fedorova@tvema.ru;
Thu, 18 Nov 2021 15:20:36 +0300 (MSK)
Received: from gater.ugr.tvema.ru (gater.ugr.tvema.ru [172.16.0.1])
by mail.tvema.ru (Postfix) with ESMTPS id 33665426351A
for fedorova@tvema.ru; Thu, 18 Nov 2021 15:20:36 +0300 (MSK)
X-Spam: yes
X-Spam-Score: 9.899999 / 15
X-Spam-Status: Yes, score=9.900 required=15.000
tests=[ARC_NA=0.000, ARC_SIGNED=0.000, ASN=0.000, BAYES_SPAM=5.100
BOUNCE=-0.100, BROKEN_HEADERS=10.000, DMARC_POLICY_ALLOW=-0.500
FROM_NO_DN=0.000, GREYLIST=0.000, MIME_GOOD=-0.100, MIME_TRACE=0.000
NEURAL_SPAM=0.000, ONCE_RECEIVED=0.100, PREVIOUSLY_DELIVERED=0.000
RCPT_COUNT_ONE=0.000, RCVD_COUNT_ONE=0.000, RCVD_IN_DNSWL_MED=-0.400
RCVD_TLS_ALL=0.000, REPLY=-4.000, R_DKIM_NA=0.000, R_SPF_ALLOW=-0.200
TO_DN_NONE=0.000, TO_MATCH_ENVRCPT_ALL=0.000]
X-Spam-Flag: YES
Received: from ul-edge.skbkontur.ru (ul-edge.skbkontur.ru [46.17.201.48])
by tvema.ru (OpenSMTPD) with ESMTPS id 2b8ba5af (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO)
for fedorova@tvema.ru;
Thu, 18 Nov 2021 15:20:35 +0300 (MSK)
MIME-Version: 1.0
From: postmaster@skbkontur.ru
To: fedorova@tvema.ru

@vstakhov
Copy link
Member

I'm not sure it happens because of from header. Could your please share any of the problematic messages with me using my personal email?

@kasak87
Copy link
Author

kasak87 commented Nov 18, 2021

I'm not sure it happens because of from header. Could your please share any of the problematic messages with me using my personal email?

sent a couple. Thank's!

@vstakhov
Copy link
Member

Hum, you MTA sends an empty string for DSN instead of <>. I have added a workaround on Rspamd side but it looks weird.

@kasak87
Copy link
Author

kasak87 commented Nov 19, 2021

Thank you! I can assure you, this is not only my mta work like this, there are tons of similar mails, as you can see, bayes have autolearned from this messages and now consider them all as spam.

c-rosenberg pushed a commit to HeinleinSupport/rspamd that referenced this issue Feb 27, 2022
@stale
Copy link

stale bot commented Apr 17, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Apr 17, 2022
@kasak87
Copy link
Author

kasak87 commented Apr 22, 2022

no problems with new rspamd 3.2 in OpenBSD 7.1!
Thanks a lot!

@kasak87 kasak87 closed this as completed Apr 22, 2022
c-rosenberg pushed a commit to HeinleinSupport/rspamd that referenced this issue Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants