On 2024/12/26 06:04, Wietse Venema via Postfix-users wrote:
Cowbay via Postfix-users:
Hello,

My Postfix is 3.4.23-0+deb10u2. It's old.

I got a rare mail with the Resent-Sender header and no other Resent- headers.

Since I configured the local_header_rewrite_clients, cleanup(8) insert the 
missing Resent- headers for this mail.

According to RFC 5322 Appendix A.3. 
(https://datatracker.ietf.org/doc/html/rfc5322#appendix-A.3)

      resent fields are prepended to the message:
     ----
     Resent-From: Mary Smith <m...@example.net>
     Resent-To: Jane Brown <j-brown@other.example>
     Resent-Date: Mon, 24 Nov 1997 14:22:01 -0800
     Resent-Message-ID: <78...@example.net>
     From: John Doe <jdoe@machine.example>
     To: Mary Smith <m...@example.net>
     Subject: Saying Hello
     Date: Fri, 21 Nov 1997 09:55:06 -0600
     Message-ID: <1234@local.machine.example>

     This is a message just to say hello.
     So, "Hello".
     ----

However cleanup(8) didn't prepend but append. It's like below:
     ----
     From: John Doe <jdoe@machine.example>
     To: Mary Smith <m...@example.net>
     Subject: Saying Hello
     Date: Fri, 21 Nov 1997 09:55:06 -0600
     Message-ID: <1234@local.machine.example>
     Resent-From: Mary Smith <m...@example.net>
     Resent-To: Jane Brown <j-brown@other.example>
     Resent-Date: Mon, 24 Nov 1997 14:22:01 -0800
     Resent-Message-ID: <78...@example.net>

     This is a message just to say hello.
     So, "Hello".
     ----


There is another interesting behavior that if there is no Message-Id
header, cleanup(8) won't insert the Message-Id header and append
all missing Resent- headers.

Postfix adds a missing (Resent) Message-ID, Date, or From header
when a message is received as an original or resent submission, not
when it receives a message from a remote MTA (for some definition
of 'remote').

(Postfix detects that a message is resent when it contains a Resent-
header, including Resent-From, Resent-Message-Id, Resent-To,
Resent-Cc, Resent-Bcc, Resent-Reply-To, or Resent-Sender).

Okay. In my situation the mail should be from remote MTA (from port 25).

And since Postfix detected the Resent-Sender, then it adds the missing Resent- 
headers.

The Postfix Resent- implementation is based on RFC 822 which in
section 4.1 syntax appears to suggest that 'originator' (From:,
Sender:) come before before 'resent' (Resent-From:, Resent-Sender).

Also, in RFC 822 the interpretation of multiple "Resent-" fields
of the same type was explicitly undefined. There were no multiple
Resent- blocks, let alone whether a newer Resent- block precedes
or follows an older one.

Thus, the Postfix implementation supports one Resent- block, and
its placement meets RFC 822 requirements.

(The implementation was done at a time that prepending would have
been technically impossible, because Postfix reads and writes out
headers one by one, and it would not have been able to prepend
something to a header that it had already written out.)

So yeah, you can blame me for not parsing RFC 5322 for changes
in Resent handling.

        Wietse
I post this issue just in case Postfix has unknown bugs. Now I know that it's 
by design.

And actually I have no email clients that could send Resent- mails. There is a feature 
"Redirect" in Thunderbird but the redirected mails have new Date and To headers 
without any Resent- header, so it's not Resent-.

Thank you for the details.

_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

Reply via email to