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

Modified Files:
        Filters.cpp 
Log Message:
check for a case when X-Authentification-Warning is benign

Index: Filters.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/modules/Filters.cpp,v
retrieving revision 1.121
retrieving revision 1.122
diff -b -u -2 -r1.121 -r1.122
--- Filters.cpp 1 Jul 2002 11:57:45 -0000       1.121
+++ Filters.cpp 1 Jul 2002 15:03:48 -0000       1.122
@@ -1903,9 +1903,39 @@
 {
    // check for "^.*Host.+claimed to be.+$" regex manually
-   const char *pc = strstr(value, "Host");
+   static const char *HOST_STRING = "Host ";
+   static const char *CLAIMED_STRING = "claimed to be ";
+
+   const char *pc = strstr(value, HOST_STRING);
+   if ( !pc )
+      return false;
+
+   const char *pc2 = strstr(pc + 1, CLAIMED_STRING);
    if ( !pc )
       return false;
 
-   return strstr(pc + 1, "claimed to be") != NULL;
+   // there seems to be a common mosconfiguration problem with some LANs which
+   // results in values of X-Authentication-Warning header like
+   //
+   //    smtpserver.domain.com: Host host.domain.com [ip] claimed to be host
+   //
+   // which are, of course, harmless, i.e. don't mean that this is spam, so we
+   // try to filter them out
+
+   // skip to the hostnames
+   pc += strlen(HOST_STRING);
+   pc2 += strlen(CLAIMED_STRING);
+
+   // check if they're equal
+   while ( *pc != '.' && *pc2 != '\r' )
+   {
+      if ( *pc++ != *pc2++ )
+      {
+         // hosts don't match, so it's a serious warning
+         return true;
+      }
+   }
+
+   // did the host names match?
+   return *pc == '.' && *pc2 == '\r';
 }
 



-------------------------------------------------------
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