git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@1133 77e5149b-7576-45b1-b177-96237e5ba77b
Nigel Horne authored on 2004/11/27 23:41:41... | ... |
@@ -17,6 +17,9 @@ |
17 | 17 |
* |
18 | 18 |
* Change History: |
19 | 19 |
* $Log: mbox.c,v $ |
20 |
+ * Revision 1.189 2004/11/27 14:39:01 nigelhorne |
|
21 |
+ * Honour section 7.2.6 of RFC1521 |
|
22 |
+ * |
|
20 | 23 |
* Revision 1.188 2004/11/27 14:17:35 nigelhorne |
21 | 24 |
* Handle attachments before the first mime section |
22 | 25 |
* |
... | ... |
@@ -552,7 +555,7 @@ |
552 | 552 |
* Compilable under SCO; removed duplicate code with message.c |
553 | 553 |
* |
554 | 554 |
*/ |
555 |
-static char const rcsid[] = "$Id: mbox.c,v 1.188 2004/11/27 14:17:35 nigelhorne Exp $"; |
|
555 |
+static char const rcsid[] = "$Id: mbox.c,v 1.189 2004/11/27 14:39:01 nigelhorne Exp $"; |
|
556 | 556 |
|
557 | 557 |
#if HAVE_CONFIG_H |
558 | 558 |
#include "clamav-config.h" |
... | ... |
@@ -1671,6 +1674,15 @@ parseEmailBody(message *messageIn, text *textIn, const char *dir, const table_t |
1671 | 1671 |
cli_dbgmsg("multipart/knowbot parsed as multipart/mixed for now\n"); |
1672 | 1672 |
mimeSubtype = "mixed"; |
1673 | 1673 |
break; |
1674 |
+ case -1: |
|
1675 |
+ /* |
|
1676 |
+ * According to section 7.2.6 of |
|
1677 |
+ * RFC1521, unrecognised multiparts |
|
1678 |
+ * should be treated as multipart/mixed. |
|
1679 |
+ */ |
|
1680 |
+ cli_warnmsg("Unsupported multipart format `%s', parsed as mixed\n", mimeSubtype); |
|
1681 |
+ mimeSubtype = "mixed"; |
|
1682 |
+ break; |
|
1674 | 1683 |
} |
1675 | 1684 |
|
1676 | 1685 |
/* |
... | ... |
@@ -1773,30 +1785,11 @@ parseEmailBody(message *messageIn, text *textIn, const char *dir, const table_t |
1773 | 1773 |
case ALTERNATIVE: |
1774 | 1774 |
cli_dbgmsg("Multipart alternative handler\n"); |
1775 | 1775 |
|
1776 |
-#if 0 |
|
1777 |
- htmltextPart = getTextPart(messages, multiparts); |
|
1778 |
- |
|
1779 |
- if(htmltextPart == -1) |
|
1780 |
- htmltextPart = 0; |
|
1781 |
- |
|
1782 |
- aMessage = messages[htmltextPart]; |
|
1783 |
- aText = textAddMessage(aText, aMessage); |
|
1784 |
- |
|
1785 |
- rc = parseEmailBody(NULL, aText, dir, rfc821Table, subtypeTable, options); |
|
1786 |
- |
|
1787 |
- if(rc == 1) |
|
1788 |
- /* |
|
1789 |
- * Alternative message has saved its |
|
1790 |
- * attachments, ensure we don't do |
|
1791 |
- * the same thing |
|
1792 |
- */ |
|
1793 |
- rc = 2; |
|
1794 |
-#endif |
|
1795 |
- |
|
1796 | 1776 |
/* |
1797 | 1777 |
* Fall through - some clients are broken and |
1798 | 1778 |
* say alternative instead of mixed. The Klez |
1799 |
- * virus is broken that way |
|
1779 |
+ * virus is broken that way, and anyway we |
|
1780 |
+ * wish to scan all of the alternatives |
|
1800 | 1781 |
*/ |
1801 | 1782 |
case REPORT: |
1802 | 1783 |
/* |
... | ... |
@@ -2072,14 +2065,7 @@ parseEmailBody(message *messageIn, text *textIn, const char *dir, const table_t |
2072 | 2072 |
|
2073 | 2073 |
break; |
2074 | 2074 |
default: |
2075 |
- /* |
|
2076 |
- * According to section 7.2.6 of RFC1521, |
|
2077 |
- * unrecognised multiparts should be treated as |
|
2078 |
- * multipart/mixed. I don't do this yet so |
|
2079 |
- * that I can see what comes along... |
|
2080 |
- */ |
|
2081 |
- cli_warnmsg("Unsupported multipart format `%s' - report to bugs@clamav.net\n", mimeSubtype); |
|
2082 |
- rc = 0; |
|
2075 |
+ assert(0); |
|
2083 | 2076 |
} |
2084 | 2077 |
|
2085 | 2078 |
if(mainMessage && (mainMessage != messageIn)) |