Update of /cvsroot/mahogany/M/src/modules
In directory sc8-pr-cvs1:/tmp/cvs-serv23951/src/modules

Modified Files:
        Filters.cpp 
Log Message:
don't detect messages with a single word in caps in subject as spam

Index: Filters.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/modules/Filters.cpp,v
retrieving revision 1.145
retrieving revision 1.146
diff -b -u -2 -r1.145 -r1.146
--- Filters.cpp 8 Apr 2003 15:04:27 -0000       1.145
+++ Filters.cpp 21 Jun 2003 10:57:22 -0000      1.146
@@ -1928,6 +1928,6 @@
 static bool CheckSubjectForCapitals(const String& subject)
 {
-   size_t len = 0;
-   for ( const char *pc = subject; *pc; pc++, len++ )
+   bool hasSpace = false;
+   for ( const char *pc = subject; *pc; pc++ )
    {
       if ( islower(*pc) )
@@ -1936,10 +1936,15 @@
          return false;
       }
+
+      if ( isspace(*pc) )
+      {
+         // remember that we have more than one word
+         hasSpace = true;
+      }
    }
 
-   // it is possible to have a short subjectentirely capitalized in a
-   // legitime message if it short enough (e.g. "USA" or "HI"...) but if it's a
-   // long sentence containing only caps, it's probabyl spam
-   return len > 8;
+   // message with a single work in all caps can be legitimate but if we have a
+   // sentence (i.e. more than one word here) in all caps it is very suspicious
+   return hasSpace;
 }
 



-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to