[exim-cvs] Truncate overlong lines in DSNs. Bug 2979

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Exim Git Commits Mailing List
Datum:  
To: exim-cvs
Betreff: [exim-cvs] Truncate overlong lines in DSNs. Bug 2979
Gitweb: https://git.exim.org/exim.git/commitdiff/cfeaa009b9b407d8b404438afbf4c5d85d61e8c1
Commit:     cfeaa009b9b407d8b404438afbf4c5d85d61e8c1
Parent:     c5722bc5a8df130f4733ca3c4398ae51cc7842e0
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Sat Mar 4 22:55:01 2023 +0000
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Sun Mar 5 12:49:22 2023 +0000


    Truncate overlong lines in DSNs.  Bug 2979
---
 src/src/deliver.c | 5 +++++
 test/stdout/0635  | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)


diff --git a/src/src/deliver.c b/src/src/deliver.c
index d0e6d1c2e..9b77b3619 100644
--- a/src/src/deliver.c
+++ b/src/src/deliver.c
@@ -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'));
+      }
     }
 }


diff --git a/test/stdout/0635 b/test/stdout/0635
index b4bfe581f..3d494c0c5 100644
--- a/test/stdout/0635
+++ b/test/stdout/0635
@@ -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@???>:
     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