Update of /cvsroot/mahogany/M/src/mail
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv3360/src/mail

Modified Files:
        SpamFilter.cpp 
Log Message:
improved filtering messages for whitelisted messages

Index: SpamFilter.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/mail/SpamFilter.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -b -u -2 -r1.16 -r1.17
--- SpamFilter.cpp      25 Jun 2006 14:19:52 -0000      1.16
+++ SpamFilter.cpp      25 Jun 2006 14:45:13 -0000      1.17
@@ -250,16 +250,33 @@
 
       // DoCheckIfSpam() may return -1 in addition to true or false which is
-      // treated as "definiively false", i.e. not only this spam filter didn't
+      // treated as "definitively false", i.e. not only this spam filter didn't
       // recognize this message as spam but it shouldn't be even checked with
       // the others (this is mainly used for whitelisting support)
-      int rc = p->DoCheckIfSpam(msg, param, result);
-      if ( rc != false )
+      switch ( p->DoCheckIfSpam(msg, param, result) )
       {
+         case true:
          if ( result )
-            *result = name + _T(": ") + *result;
+            {
+               *result = String::Format("recognized as spam by %s filter: %s",
+                                        name.c_str(), result->c_str());
+            }
+            return true;
+
+         case -1:
+            if ( result )
+            {
+               *result = String::Format("recognized as non-spam by %s filter: 
%s",
+                                        name.c_str(), result->c_str());
+            }
+            return false;
 
-         return rc != -1;
+         default:
+            FAIL_MSG( "unexpected DoCheckIfSpam() return value" );
+            // fall through
+
+         case false:
+            // continue with the other filters checks
+            break;
       }
-      //else: continue with the other filters checks
    }
 


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Mahogany-cvsupdates mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to