summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2025-01-27 12:38:06 +0100
committermanuel <manuel@mausz.at>2025-01-27 12:38:06 +0100
commit0cd96fce7e5477aebed341e996fcc903f0e6a835 (patch)
tree059625d2e33cfc2427a8206f1d725778189091e3
parenta77adb886ef7ed2efa8441dcd823d5f7e3f97183 (diff)
downloadqmail-master.tar.gz
qmail-master.tar.bz2
qmail-master.zip
Fix utf8received failing to detect empty newlines (body starts)HEADmaster
This resulted in invalid mail encoding (bare LF, \r\n\n)
-rw-r--r--qmail-remote.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/qmail-remote.c b/qmail-remote.c
index 14114cf..ee2c6a8 100644
--- a/qmail-remote.c
+++ b/qmail-remote.c
@@ -777,7 +777,10 @@ int utf8received()
777 } 777 }
778 } 778 }
779 if (!stralloc_copys(&receivedline,"")) temp_nomem(); 779 if (!stralloc_copys(&receivedline,"")) temp_nomem();
780 receivedline.len = 0; 780 } else if (ch == '\n' && !receivedline.len) { /* we got an empty newline. probably body start */
781 if (!stralloc_append(&header,"\r")) temp_nomem();
782 if (!stralloc_append(&header,"\n")) temp_nomem();
783 return 0;
781 } else { 784 } else {
782 if (!stralloc_append(&header,&ch)) temp_nomem(); 785 if (!stralloc_append(&header,&ch)) temp_nomem();
783 if (!stralloc_catb(&receivedline,&ch,1)) temp_nomem(); 786 if (!stralloc_catb(&receivedline,&ch,1)) temp_nomem();