Browse code

some attachments were not being scanned (NJH, bb#660)

git-svn: trunk@3373

Tomasz Kojm authored on 2007/12/06 23:57:24
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Thu Dec  6 15:11:25 CET 2007 (tk)
2
+---------------------------------
3
+  * libclamav/mbox.c: some attachments were not being scanned (NJH, bb#660)
4
+
1 5
 Thu Dec  6 15:08:01 CET 2007 (tk)
2 6
 ---------------------------------
3 7
   * libclamav/htmlnorm.c: properly truncate long URLs (Edwin, bb#645)
... ...
@@ -2770,6 +2770,15 @@ parseEmailBody(message *messageIn, text *textIn, mbox_ctx *mctx, unsigned int re
2770 2770
 				free(messages);
2771 2771
 			return rc;
2772 2772
 
2773
+		default:
2774
+			cli_warnmsg("Message received with unknown mime encoding - assume application");
2775
+			/*
2776
+			 * Some Yahoo emails attach as
2777
+			 * Content-Type: X-unknown/unknown;
2778
+			 * instead of
2779
+			 * Content-Type: application/unknown;
2780
+			 * so let's try our best to salvage something
2781
+			 */
2773 2782
 		case APPLICATION:
2774 2783
 			/*cptr = messageGetMimeSubtype(mainMessage);
2775 2784
 
... ...
@@ -2797,10 +2806,6 @@ parseEmailBody(message *messageIn, text *textIn, mbox_ctx *mctx, unsigned int re
2797 2797
 		case VIDEO:
2798 2798
 		case IMAGE:
2799 2799
 			break;
2800
-
2801
-		default:
2802
-			cli_warnmsg("Message received with unknown mime encoding");
2803
-			break;
2804 2800
 		}
2805 2801
 
2806 2802
 		if(messages) {
... ...
@@ -5087,9 +5092,9 @@ do_multipart(message *mainMessage, message **messages, int i, mbox_status *rc, m
5087 5087
 			}
5088 5088
 			return mainMessage;
5089 5089
 		default:
5090
-			cli_warnmsg("Only text and application attachments are supported, type = %d\n",
5090
+			cli_warnmsg("Only text and application attachments are fully supported, type = %d\n",
5091 5091
 				messageGetMimeType(aMessage));
5092
-			return mainMessage;
5092
+			/* fall through - we may be able to salvage something */
5093 5093
 	}
5094 5094
 
5095 5095
 	if(*rc != VIRUS) {