Index:
[thread]
[date]
[author]
[stats]
From: markus schnalke <meillo@marmaro.de>
To : <masqmail@marmaro.de>
Date: Wed, 16 Jun 2010 19:24:50 +0200
Long lines in message body
Hoi,
I came across a mail message with very long lines in the body. It was
truncated right before the long line. Long lines means more than 4096
chars. The number 4096 is defined as MAX_DATALINE in masqmail.h.
The spooled files were okay. The problem was in the code that reads
spooled files for delivery. Actually, the problem was only that the
case of lines longer than 4096 chars was handled badly. The fix is
quite simple: End the buffer with \0 and return the size of the full
buffer, instead of returning 0.
diff -r 0a5b2e96ade3 -r 257a9e6d1a8e src/spool.c
--- a/src/spool.c Wed Jun 16 10:39:44 2010 +0200
+++ b/src/spool.c Wed Jun 16 19:06:34 2010 +0200
@@ -29,7 +29,9 @@
while ((c = getc(in)) != '\n' && (c != EOF)) {
if (p >= buf_len - 1) {
- return 0;
+ buf[buf_len-1] = '\0';
+ ungetc(c, in);
+ return buf_len;
}
buf[p++] = c;
}
Masqmail should be able to deal with arbitrary long lines now, but I
can't guarantee. I haven't checked the get facility. If you discover
strange behavior related to this issue, please let me know.
meillo
Index:
[thread]
[date]
[author]
[stats]