On Fri, Aug 26, 2022 at 01:26:26PM -0400, post...@ptld.com wrote: > > Postfix is NOT unfolding the subject, and so not surprisingly not > > removing the CRLF (really just LF when presented to header_checks, > > logs, delivered to unix files, ...). > > See now that confuses me again. > > I thought the process of folding and unfolding was the act of breaking > long lines into multiple lines and then restoring them. But now I'm > being told that when postfix combines multiple lines into one line for > the subject header that is not unfolding? Or do you mean because a > CRLF wasn't removed in the process of combining multiple lines, that > alone means it isn't "unfolding"?
Correct. Postfix maintains the header in multi-line form. There is no "unfolding" performed. Any such unfolding is up to the MUA that presents the message to a user (or some bot parsing the delivered message). > And regardless of all of these semantic technicalities, why wouldn't > you want to remove CR or LF or CRLF from the end of a line being > appended to when you are combining multiple lines regardless if you > want to call it unfolding or not-unfolding? Postfix preserves and processes the verbatim header. Whether unfolding by removing CRLF and following whitespace is appropriate or not requires detailed knowledge of the message header syntax that is the job of MUAs, not the MTA. > Clearly the intent is for those multiple lines to be one line, as > evident of them staring with a WSP, and any CR or LF or CRLF only > exist due to folding (or not-folding). Postfix is not in the business of guessing intent. Valid multi-line header in -> valid multi-line header out. If any of the physical header lines exceed the 1000 byte limit (including CRLF), then garbage in -> garbage out: Postfix will brutaly fold the header at ~998 bytes potentially i.e. often at a completely inappropriate place. -- Viktor.