git-svn: trunk@2280
Nigel Horne authored on 2006/09/16 19:38:17... | ... |
@@ -16,7 +16,7 @@ |
16 | 16 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
17 | 17 |
* MA 02110-1301, USA. |
18 | 18 |
*/ |
19 |
-static char const rcsid[] = "$Id: mbox.c,v 1.333 2006/09/16 09:53:56 njh Exp $"; |
|
19 |
+static char const rcsid[] = "$Id: mbox.c,v 1.334 2006/09/16 10:38:17 njh Exp $"; |
|
20 | 20 |
|
21 | 21 |
#if HAVE_CONFIG_H |
22 | 22 |
#include "clamav-config.h" |
... | ... |
@@ -235,7 +235,7 @@ static message *do_multipart(message *mainMessage, message **messages, int i, in |
235 | 235 |
static int count_quotes(const char *buf); |
236 | 236 |
static bool next_is_folded_header(const text *t); |
237 | 237 |
|
238 |
-static void checkURLs(message *m, mbox_ctx *mctx,int *rc,int is_html); |
|
238 |
+static void checkURLs(message *m, mbox_ctx *mctx,int *rc, int is_html); |
|
239 | 239 |
|
240 | 240 |
#ifdef CL_EXPERIMENTAL |
241 | 241 |
static void do_checkURLs(message *m, const char *dir,tag_arguments_t* hrefs); |
... | ... |
@@ -1992,11 +1992,13 @@ parseEmailBody(message *messageIn, text *textIn, mbox_ctx *mctx) |
1992 | 1992 |
if(!doPhishingScan) |
1993 | 1993 |
break; |
1994 | 1994 |
/*else: fall-through: some phishing mails claim they are text/plain, when they are indeed html*/ |
1995 |
+#else |
|
1996 |
+ break; |
|
1995 | 1997 |
#endif |
1996 | 1998 |
case TEXT: |
1997 | 1999 |
/* text/plain has been preprocessed as no encoding */ |
1998 | 2000 |
#ifdef CL_EXPERIMENTAL |
1999 |
- if(subtype==HTML || doPhishingScan) { |
|
2001 |
+ if((subtype == HTML) || doPhishingScan) { |
|
2000 | 2002 |
#else |
2001 | 2003 |
if((mctx->ctx->options&CL_SCAN_MAILURL) && (subtype == HTML)) |
2002 | 2004 |
#endif |
... | ... |
@@ -2005,11 +2007,14 @@ parseEmailBody(message *messageIn, text *textIn, mbox_ctx *mctx) |
2005 | 2005 |
* file and only checkURLs if it's found to be |
2006 | 2006 |
* clean |
2007 | 2007 |
*/ |
2008 |
- checkURLs(mainMessage, mctx, &rc,subtype==HTML);/* there might be html sent without subtype html too, |
|
2009 |
- so scan them for phishing too*/ |
|
2008 |
+ checkURLs(mainMessage, mctx, &rc, (subtype == HTML)); |
|
2010 | 2009 |
#ifdef CL_EXPERIMENTAL |
2010 |
+ /* |
|
2011 |
+ * There might be html sent without subtype |
|
2012 |
+ * html too, so scan them for phishing |
|
2013 |
+ */ |
|
2011 | 2014 |
if(rc == 3) |
2012 |
- infected=TRUE; |
|
2015 |
+ infected = TRUE; |
|
2013 | 2016 |
} |
2014 | 2017 |
#endif |
2015 | 2018 |
break; |
... | ... |
@@ -4136,7 +4141,7 @@ checkURLs(message *m, mbox_ctx *mctx, int* rc, int is_html) |
4136 | 4136 |
{ |
4137 | 4137 |
} |
4138 | 4138 |
#endif |
4139 |
-#endif /* ! CL_EXPERIMENTAL */ |
|
4139 |
+#endif /* CL_EXPERIMENTAL */ |
|
4140 | 4140 |
|
4141 | 4141 |
#if defined(FOLLOWURLS) && (FOLLOWURLS>0) |
4142 | 4142 |
/* |
... | ... |
@@ -4641,12 +4646,9 @@ do_multipart(message *mainMessage, message **messages, int i, int *rc, mbox_ctx |
4641 | 4641 |
free(filename); |
4642 | 4642 |
} |
4643 | 4643 |
} else { |
4644 |
- const int is_html = tableFind(mctx->subtypeTable, cptr) == HTML; |
|
4645 |
-#ifdef CL_EXPERIMENTAL |
|
4646 | 4644 |
if(mctx->ctx->options&CL_SCAN_MAILURL) |
4647 |
- if(is_html) |
|
4648 |
-#endif |
|
4649 |
- checkURLs(aMessage, mctx, rc, is_html); |
|
4645 |
+ if(tableFind(mctx->subtypeTable, cptr) == HTML) |
|
4646 |
+ checkURLs(aMessage, mctx, rc, 1); |
|
4650 | 4647 |
messageAddArgument(aMessage, |
4651 | 4648 |
"filename=mixedtextportion"); |
4652 | 4649 |
} |