Wietse Venema via Postfix-users wrote in <4vtlbf3vz0zj...@spike.porcupine.org>: |Postfix does not store line endings internally, because different |environments have different line ending conventions (for example |SMTP has <CR><LF> while UNIX has <LF>). Postfix strips line endings |on input, and adds them on output. Postfix was modeled after routers |with different kinds of network interfaces.
'has nothing to do with the line endings. On some lonely IETF place i posted code snippets of opendkim's header parsing, he knows that very well. |The Postfix sendmail command allows both <CR><LF> and <LF>, because |too many app developers were messing up. | |As of January 2024, Postfix replaces any <CR> and <LF> that are not |part of a line ending with space. This prevents outbound SMTP |smuggling, and makes DKIM signatures more likely to verify. The |default setting "cleanup_replace_stray_cr_lf = yes" was added in |Postfix 3.9, 3.8.5, 3.7.10, 3.6.14, and 3.5.24 later. | |Returning to the problem at hand, the options that I see are: | |- Forward the message including all its MIME headers, and leave | the decoding to the recipient's mail software. | |- Use a real MIME parser and decoder to extract the plain text | that you want to forward. | |The trick to strip " =" works only for quoted-printable encoding, |but does not handle messages encoded in base64. But one thing is plain, if lines get folded "artificially" to satisfy line length limits, then this is a whitespace that DKIM will see, and if it was not in the original message, the signature will break. The only possibility to get over this hurdle is to apply RFC 2047 (or RFC 2231, in a parameter) MIME encoding, and then (for RFC 2047) the software needs to be able to understand the character set of the data in order not to break up multibyte characters (not possible with ISO C, iconv can this, a bit), because 2047 generates "atomic units" instead of a stream that is united like 2231. --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt) _______________________________________________ Postfix-users mailing list -- postfix-users@postfix.org To unsubscribe send an email to postfix-users-le...@postfix.org