diff --git a/clamav-devel/ChangeLog b/clamav-devel/ChangeLog index 26514ffd3..bf0c353ca 100644 --- a/clamav-devel/ChangeLog +++ b/clamav-devel/ChangeLog @@ -1,3 +1,8 @@ +Sat Dec 4 15:52:08 GMT 2004 (njh) +---------------------------------- + * libclamav/mbox.c: Handle text/rfc822-headers incorrectly sent as + message/rfc822-headers + Fri Dec 3 17:36:08 GMT 2004 (njh) ---------------------------------- * clamav-milter: internal: Honour scanning modes and archive limits diff --git a/clamav-devel/libclamav/mbox.c b/clamav-devel/libclamav/mbox.c index f00179b71..03b0e1d14 100644 --- a/clamav-devel/libclamav/mbox.c +++ b/clamav-devel/libclamav/mbox.c @@ -17,6 +17,9 @@ * * Change History: * $Log: mbox.c,v $ + * Revision 1.197 2004/12/04 15:50:39 nigelhorne + * Handle text/rfc822-headers incorrectly sent as message/rfc822-headers + * * Revision 1.196 2004/12/01 13:12:35 nigelhorne * Decode text/plain parts marked as being encoded * @@ -576,7 +579,7 @@ * Compilable under SCO; removed duplicate code with message.c * */ -static char const rcsid[] = "$Id: mbox.c,v 1.196 2004/12/01 13:12:35 nigelhorne Exp $"; +static char const rcsid[] = "$Id: mbox.c,v 1.197 2004/12/04 15:50:39 nigelhorne Exp $"; #if HAVE_CONFIG_H #include "clamav-config.h" @@ -1345,6 +1348,7 @@ parseEmailBody(message *messageIn, text *textIn, const char *dir, const table_t mimeSubtype = messageGetMimeSubtype(mainMessage); subtype = tableFind(subtypeTable, mimeSubtype); + /* pre-process */ if((mimeType == TEXT) && (subtype == PLAIN)) { /* * This is effectively no encoding, notice that we @@ -1353,6 +1357,15 @@ parseEmailBody(message *messageIn, text *textIn, const char *dir, const table_t cli_dbgmsg("assume no encoding\n"); mimeType = NOMIME; messageSetMimeSubtype(mainMessage, NULL); + } else if((mimeType == MESSAGE) && + (strcasecmp(mimeSubtype, "rfc822-headers") == 0)) { + /* + * RFC1892/RFC3462: section 2 text/rfc822-headers + * incorrectly sent as message/rfc822-headers + */ + cli_dbgmsg("Changing message/rfc822-headers to text/rfc822-headers\n"); + mimeType = TEXT; + subtype = PLAIN; /* parse as text/plain */ } cli_dbgmsg("mimeType = %d\n", mimeType);