git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@522 77e5149b-7576-45b1-b177-96237e5ba77b
Nigel Horne authored on 2004/04/23 19:50:26... | ... |
@@ -1,3 +1,9 @@ |
1 |
+Fri Apr 23 11:48:07 BST 2004 (njh) |
|
2 |
+---------------------------------- |
|
3 |
+ * libclamav/mbox.c: If an inline text portion has been given a filename, |
|
4 |
+ treat the disposition type as attachment not inline. Some |
|
5 |
+ Worm.BadTrans.B1 need this. |
|
6 |
+ |
|
1 | 7 |
Fri Apr 23 10:14:00 BST 2004 (njh) |
2 | 8 |
---------------------------------- |
3 | 9 |
* clamav-milter: Ensure only From lines are escaped |
... | ... |
@@ -17,6 +17,9 @@ |
17 | 17 |
* |
18 | 18 |
* Change History: |
19 | 19 |
* $Log: mbox.c,v $ |
20 |
+ * Revision 1.67 2004/04/23 10:47:41 nigelhorne |
|
21 |
+ * If an inline text portion has a filename treat is as an attachment |
|
22 |
+ * |
|
20 | 23 |
* Revision 1.66 2004/04/14 08:32:21 nigelhorne |
21 | 24 |
* When debugging print the email number in mailboxes |
22 | 25 |
* |
... | ... |
@@ -189,7 +192,7 @@ |
189 | 189 |
* Compilable under SCO; removed duplicate code with message.c |
190 | 190 |
* |
191 | 191 |
*/ |
192 |
-static char const rcsid[] = "$Id: mbox.c,v 1.66 2004/04/14 08:32:21 nigelhorne Exp $"; |
|
192 |
+static char const rcsid[] = "$Id: mbox.c,v 1.67 2004/04/23 10:47:41 nigelhorne Exp $"; |
|
193 | 193 |
|
194 | 194 |
#if HAVE_CONFIG_H |
195 | 195 |
#include "clamav-config.h" |
... | ... |
@@ -1031,6 +1034,7 @@ parseEmailBody(message *messageIn, blob **blobsIn, int nBlobs, text *textIn, con |
1031 | 1031 |
messageSetEncoding(aMessage, "x-uuencode"); |
1032 | 1032 |
addAttachment = TRUE; |
1033 | 1033 |
} else if(strcasecmp(messageGetMimeSubtype(aMessage), "plain") == 0) { |
1034 |
+ char *filename; |
|
1034 | 1035 |
/* |
1035 | 1036 |
* Strictly speaking |
1036 | 1037 |
* a text/html part is |
... | ... |
@@ -1039,8 +1043,19 @@ parseEmailBody(message *messageIn, blob **blobsIn, int nBlobs, text *textIn, con |
1039 | 1039 |
* we can decode and |
1040 | 1040 |
* scan it |
1041 | 1041 |
*/ |
1042 |
- cli_dbgmsg("Adding part to main message\n"); |
|
1043 |
- addToText = TRUE; |
|
1042 |
+ filename = (char *)messageFindArgument(aMessage, "filename"); |
|
1043 |
+ if(filename == NULL) |
|
1044 |
+ filename = (char *)messageFindArgument(aMessage, "name"); |
|
1045 |
+ |
|
1046 |
+ if(filename == NULL) { |
|
1047 |
+ cli_dbgmsg("Adding part to main message\n"); |
|
1048 |
+ addToText = TRUE; |
|
1049 |
+ } else { |
|
1050 |
+ cli_dbgmsg("Treating %s as attachment\n", |
|
1051 |
+ filename); |
|
1052 |
+ free(filename); |
|
1053 |
+ addAttachment = TRUE; |
|
1054 |
+ } |
|
1044 | 1055 |
} else { |
1045 | 1056 |
messageAddArgument(aMessage, "filename=textportion"); |
1046 | 1057 |
addAttachment = TRUE; |