From 3b17cca53e4b33c356adce13aa09ed2300b07617 Mon Sep 17 00:00:00 2001 From: "scott%scott-macgregor.org" Date: Wed, 2 Jun 2004 17:24:17 +0000 Subject: [PATCH] Bug #244722 --> Message truncated in headers stops mail from automatically moving all junk messages Patch by Lorenzo Colitti sr=mscott git-svn-id: svn://10.0.0.236/trunk@157318 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/mailnews/mime/src/mimemsg.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mozilla/mailnews/mime/src/mimemsg.cpp b/mozilla/mailnews/mime/src/mimemsg.cpp index b9c0a94c0d4..61f5f329e9e 100644 --- a/mozilla/mailnews/mime/src/mimemsg.cpp +++ b/mozilla/mailnews/mime/src/mimemsg.cpp @@ -546,6 +546,15 @@ MimeMessage_parse_eof (MimeObject *obj, PRBool abort_p) outer_p = !obj->headers; /* is this the outermost message? */ + // Hack for messages with truncated headers (bug 244722) + // If there is no empty line in a message, the parser can't figure out where + // the headers end, causing parsing to hang. So we insert an extra newline + // to keep it happy. This is OK, since a message without any empty lines is + // broken anyway... + if(outer_p && msg->hdrs && ! msg->hdrs->done_p) { + MimeMessage_parse_line("\n", 1, obj); + } + // Once we get to the end of parsing the message, we will notify // the emitter that we are done the the body.