Update of /cvsroot/mahogany/M/src/modules/spam
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv22902/src/modules/spam

Modified Files:
        DspamFilter.cpp HeadersFilter.cpp 
Log Message:
don't even check the other spam filters if one of them has the message sender 
in its whitelist

Index: DspamFilter.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/modules/spam/DspamFilter.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -b -u -2 -r1.19 -r1.20
--- DspamFilter.cpp     16 Jan 2006 20:32:28 -0000      1.19
+++ DspamFilter.cpp     25 Jun 2006 14:19:53 -0000      1.20
@@ -163,5 +163,5 @@
    virtual void DoReclassify(const Message& msg, bool isSpam);
    virtual void DoTrain(const Message& msg, bool isSpam);
-   virtual bool DoCheckIfSpam(const Message& msg,
+   virtual int DoCheckIfSpam(const Message& msg,
                               const String& param,
                               String *result);
@@ -342,5 +342,5 @@
 }
 
-bool
+int
 DspamFilter::DoCheckIfSpam(const Message& msg,
                            const String& param,

Index: HeadersFilter.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/modules/spam/HeadersFilter.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -b -u -2 -r1.12 -r1.13
--- HeadersFilter.cpp   23 Jun 2006 23:28:26 -0000      1.12
+++ HeadersFilter.cpp   25 Jun 2006 14:19:53 -0000      1.13
@@ -208,5 +208,5 @@
    virtual void DoReclassify(const Message& msg, bool isSpam);
    virtual void DoTrain(const Message& msg, bool isSpam);
-   virtual bool DoCheckIfSpam(const Message& msg,
+   virtual int DoCheckIfSpam(const Message& msg,
                               const String& param,
                               String *result);
@@ -921,6 +921,6 @@
 
 // check whether any address field (sender or recipient) matches whitelist and
-// return true if it does
-static bool CheckWhiteList(const Message& msg)
+// return true (and fills match with the match in whitelist) if it does
+static bool CheckWhiteList(const Message& msg, String *match)
 {
    // examine all addresses in the message header for match in the whitelist
@@ -935,5 +935,5 @@
    for ( size_t n = 0; n < count; n++ )
    {
-      if ( Address::IsInList(whitelist, addresses[n]) )
+      if ( Address::IsInList(whitelist, addresses[n], match) )
          return true;
    }
@@ -1056,5 +1056,5 @@
 }
 
-bool
+int
 HeadersFilter::DoCheckIfSpam(const Message& msg,
                              const String& param,
@@ -1082,6 +1082,13 @@
       if ( tests[n] == spamTestDescs[Spam_Test_WhiteList].token )
       {
-         if ( CheckWhiteList(msg) )
-            return false;
+         String match;
+         if ( CheckWhiteList(msg, &match) )
+         {
+            if ( result )
+               result->Printf("\"%s\" is in the white list", match.c_str());
+
+            // this is definitely not a spam
+            return -1;
+         }
       }
    }


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