[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Mailbox delivery of true binary body parts
Some time ago I reported to mea that messages containg binary data
(Content-Transfer-Encoding: 8bit and real non-text bytes inside)
cannot be delivered locally via mailbox program, although they are
correcly relayed over smtp transport. Today, it seems that I fixed
the problem. Patch follows. I hope Matti will look at it.
--- transports/mailbox/mailbox.c.orig Thu Nov 21 22:49:10 1996
+++ transports/mailbox/mailbox.c Thu Dec 5 20:09:23 1996
@@ -2272,7 +2272,7 @@
expect = save;
- *lastchp = buf[len-1];
+ *lastchp = buf[len-1]&0xff;
for (cp = buf, n = len, tlen = 0, s = NULL; n > 0; --n, ++cp) {
register int c = *cp;
@@ -2368,7 +2368,7 @@
strncmp(buf+2,mime_boundary,mime_boundary_len) == 0) {
/* ------------------------------------------------------------ */
/* XX: process MIME boundary! */
- *lastchp = buf[len-1];
+ *lastchp = buf[len-1]&0xff;
return fwrite(buf, 1, len, fp);
} else if (convert_qp) {
@@ -2415,7 +2415,7 @@
return -1;
if (tlen > 0) {
i = fwrite(buf2, 1, tlen, fp);
- *lastchp = buf2[tlen-1];
+ *lastchp = buf2[tlen-1]&0xff;
} else
i = 0;
if (i != tlen) return -1;
@@ -2426,7 +2426,7 @@
/* Well, no other processings known.. */
if (!mmdf_mode && buf[0] == 'F' && strncmp(buf,"From ",5)==0)
putc('>',fp);
- *lastchp = buf[len-1];
+ *lastchp = buf[len-1]&0xff;
return fwrite(buf, 1, len, fp);
}