Browse code

Improve e-mail detection

git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@802 77e5149b-7576-45b1-b177-96237e5ba77b

Tomasz Kojm authored on 2004/08/26 22:36:35
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Thu Aug 26 15:33:50 CEST 2004 (tk)
2
+----------------------------------
3
+  * libclamav/filetypes.c: Improve e-mail detection
4
+
1 5
 Thu Aug 26 11:23:22 BST 2004 (njh)
2 6
 ----------------------------------
3 7
   * clamav-milter/clamav-milter.c: Generate correct message if there is no
... ...
@@ -64,7 +64,7 @@ static const struct cli_magic_s cli_magic[] = {
64 64
     /* Mail */
65 65
 
66 66
     {0,  "From ",			 5, "MBox",		  CL_MAILFILE},
67
-    {0,  "Received",			 8, "Raw mail",		  CL_MAILFILE},
67
+    {0,  "Received: ",			10, "Raw mail",		  CL_MAILFILE},
68 68
     {0,  "Return-Path: ",		13, "Maildir",		  CL_MAILFILE},
69 69
     {0,  "Return-path: ",		13, "Maildir",		  CL_MAILFILE},
70 70
     {0,  "Delivered-To: ",		14, "Mail",		  CL_MAILFILE},
... ...
@@ -155,7 +155,7 @@ cli_file_t cli_filetype(const char *buf, size_t buflen)
155 155
     }
156 156
 
157 157
     for(i = 0; i < buflen; i++)
158
-	if(!isprint(buf[i])) { /* FIXME: do we need to handle intern. chars? */
158
+	if(!iscntrl(buf[i]) && !isprint(buf[i])) { /* FIXME: do we need to handle intern. chars? */
159 159
 	    ascii = 0;
160 160
 	    break;
161 161
 	}