Update of /cvsroot/mahogany/M/src/modules
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21868/src/modules

Modified Files:
        Filters.cpp 
Log Message:
added spam test for executable attachments

Index: Filters.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/modules/Filters.cpp,v
retrieving revision 1.190
retrieving revision 1.191
diff -b -u -2 -r1.190 -r1.191
--- Filters.cpp 16 Mar 2004 01:19:46 -0000      1.190
+++ Filters.cpp 15 May 2004 16:42:11 -0000      1.191
@@ -2084,4 +2084,33 @@
 }
 
+// check if we have any executable attachments in this message
+static bool CheckForExeAttach(const MimePart *part)
+{
+   while ( part )
+   {
+      if ( CheckForExeAttach(part->GetNested()) )
+         return true;
+
+      String filename = part->GetParam(_T("filename")).Lower();
+      if ( !filename.empty() )
+      {
+         String ext;
+         wxSplitPath(filename, NULL, NULL, &ext);
+         wxSortedArrayString extsExe;
+         extsExe.Add(_T("scr"));
+         extsExe.Add(_T("pif"));
+         extsExe.Add(_T("hta"));
+         if ( extsExe.Index(ext) != wxNOT_FOUND )
+         {
+            return true;
+         }
+      }
+
+      part = part->GetNext();
+   }
+
+   return false;
+}
+
 // check the value of X-Spam-Status header and return true if we believe it
 // indicates that this is a spam
@@ -2722,4 +2751,9 @@
             gs_spamTest = _("not in whitelist");
       }
+      else if ( test == SPAM_TEST_EXECUTABLE_ATTACHMENT )
+      {
+         if ( CheckForExeAttach(msg->GetTopMimePart()) )
+            gs_spamTest = _("contains Windows executable attachment");
+      }
 #ifdef USE_RBL
       else if ( test == SPAM_TEST_RBL )



-------------------------------------------------------
This SF.Net email is sponsored by: SourceForge.net Broadband
Sign-up now for SourceForge Broadband and get the fastest
6.0/768 connection for only $19.95/mo for the first 3 months!
http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to