Truncate overlong lines in DSNs. Bug 2979
authorJeremy Harris <jgh146exb@wizmail.org>
Sat, 4 Mar 2023 22:55:01 +0000 (22:55 +0000)
committerJeremy Harris <jgh146exb@wizmail.org>
Sun, 5 Mar 2023 12:49:22 +0000 (12:49 +0000)
src/src/deliver.c
test/stdout/0635

index d0e6d1c2ecbd9660b30ddcd7666c4687c84c3b10..9b77b36197d16798371de1647e1f738f51df3ac3 100644 (file)
@@ -5370,6 +5370,11 @@ while (*s)
       fprintf(f, "\n   ");  /* sic (because space follows) */
       count = 0;
       }
+    else if (count > 254)      /* arbitrary limit */
+      {
+      fprintf(f, "[truncated]");
+      do s++; while (*s && !(*s == '\\' && s[1] == '\n'));
+      }
     }
 }
 
index b4bfe581fc24451c50dfd66a5811b810322cd2a6..3d494c0c5120df083f44bf39ba0e57650be9d93a 100644 (file)
@@ -52,7 +52,7 @@ recipients. This is a permanent error. The following address(es) failed:
   host 127.0.0.1 [127.0.0.1]
     SMTP error from remote mail server after RCPT TO:<fred@undeliverable.org>:
     550-no mate
-    550-123456789 100       123456789 a really long line to blow the limits   123456789 123456789 123456789 123456789 200       123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 300       123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 400       123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 500       123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 600       123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 700       123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 800       123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 900       123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 1000      123456789 12
+    550-123456789 100       123456789 a really long line to blow the limits   123456789 123456789 123456789 123456789 200       123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 300       123456789 123456789 123456789 1[truncated]
 
 --NNNNNNNNNN-eximdsn-MMMMMMMMMM
 Content-type: message/delivery-status