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

Modified Files:
        Filters.cpp 
Log Message:
added test for SpamAssassin tag

Index: Filters.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/modules/Filters.cpp,v
retrieving revision 1.119
retrieving revision 1.120
diff -b -u -2 -r1.119 -r1.120
--- Filters.cpp 27 Jun 2002 13:37:46 -0000      1.119
+++ Filters.cpp 30 Jun 2002 23:50:15 -0000      1.120
@@ -1887,4 +1887,16 @@
 }
 
+// another func_isspam() helper: check the value of X-Spam-Status
+// header and return true if we believe it indicates that this is a spam
+static bool CheckXSpamStatus(const String& value)
+{
+   // check for "^.*^X-Spam-Status: Yes+$" regex manually
+   const char *pc = strstr(value, "Yes");
+   if ( !pc )
+      return false;
+
+   return true;
+}
+
 // another func_isspam() helper: check the value of X-Authentication-Warning
 // header and return true if we believe it indicates that this is a spam
@@ -1970,4 +1982,11 @@
          // just the top level one
          rc = CheckMimePartForKoreanCSet(msg->GetTopMimePart());
+      }
+      else if ( test == SPAM_TEST_SPAMASSASSIN )
+      {
+         // SpamAssassin adds header "X-Spam-Status: Yes" to all (probably)
+         // detected spams
+         rc = msg->GetHeaderLine("X-Spam-Status", value) &&
+                  CheckXSpamStatus(value);
       }
       else if ( test == SPAM_TEST_XAUTHWARN )



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to