chiark / gitweb /
Split nameIsInList into nameIsInListRegexp (for most things) and nameIsInListExactly...
[modbot-mtm.git] / stump / bin / submission.pl
index 8a7331a88a58044f5f8e7e74710a9f4a76fb759c..f31961774a9fafbee80594f9f3735d81c8abe477 100755 (executable)
@@ -133,7 +133,7 @@ print STDERR "Too many newsgroups\n";
 # checks if poster needs acknowledgment of receipt
 #
 sub checkAck {
-  if( &nameIsInList( $From, "noack.list" ) ) {
+  if( &nameIsInListExactly( $From, "noack.list" ) ) {
     $needAck = "no";
   } else {
     $needAck = "yes";
@@ -163,8 +163,8 @@ print STDERR "FromSig = $FromSig, good = $good\n" if $FromSig;
     return "$Command_Reject signature Your PGP signature does NOT match, or is not in our keyring";
   }
 
-  if( &nameIsInList( $From, $PGPMustList ) ||
-      ($PGPCheckPreapproved && &nameIsInList($From, $goodGuys) ) ) {
+  if( &nameIsInListRegexp( $From, $PGPMustList ) ||
+      ($PGPCheckPreapproved && &nameIsInListExactly($From, $goodGuys) ) ) {
     if( $FromSig eq "" ) {
       return "$Command_Reject signature You are REQUIRED to sign your posts.";
     } 
@@ -214,7 +214,7 @@ sub Filter {
     }
   }
 
-  if( &nameIsInList( $From, $badGuys ) ) {
+  if( &nameIsInListRegexp( $From, $badGuys ) ) {
     return "$Command_Reject blocklist";
   }
 
@@ -223,7 +223,7 @@ sub Filter {
   # "suspicious" and will be forwarded to a humen mod for review.
   # As an example of a bad word may be "MAKE MONEY FAST - IT REALLY WORKS!!!"
   #
-  if( $badWord = &nameIsInList( $Body, $badWords ) ) {
+  if( $badWord = &nameIsInListRegexp( $Body, $badWords ) ) {
 print STDERR "BAD WORD $badWord FOUND!!!\n";
     return $Command_Suspicious; # messages from approved guys MAY be 
                          # suspicious if they write about
@@ -237,7 +237,7 @@ print STDERR "BAD WORD $badWord FOUND!!!\n";
   }
 
   # Checking preapproved list
-  if( &nameIsInList( $From, $goodGuys ) ) {
+  if( &nameIsInListExactly( $From, $goodGuys ) ) {
   local( $from ) = $From; $from =~ s/^From: //i;
 print STDERR "$from is a PREAPPROVED person\n";
     return $Command_Approve;