On 16/03/25 10:39, Wietse Venema via Postfix-users wrote:
That said, it should not be difficult for Postfix code to always
strip line breaks on input and to always append line breaks on
output.

That is fundmentally how all message content is handeld everywhere,
regardless off whether the line  break convention is <LF> or <CR><LF>.

This is a relatively simple patch, for the sake of simplicity it replaces the linefeed at read time, but a slightly more complicated patch that does it when lines are output to dst might be more appropriate. Note this is untested:

--- postfix-3.10.1/src/postconf/postconf_edit.c.orig 2025-03-15 16:40:20.187982007 +1300 +++ postfix-3.10.1/src/postconf/postconf_edit.c 2025-03-16 16:17:54.588023494 +1300
@@ -114,7 +114,8 @@
 {
     char   *cp;

-    while (vstring_get(buf, src) != VSTREAM_EOF) {
+    while (vstring_get_nonl(buf, src) != VSTREAM_EOF) {
+       VSTRING_ADDCH(buf, '\n');
        if (lineno)
            *lineno += 1;
        if ((cp = pcf_find_cf_info(buf, dst)) != 0)


Peter

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

Reply via email to