chiark / gitweb /
DECISION: log lines are more parseable and include an explanation of how the decision...
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 20 Apr 2010 16:53:30 +0000 (17:53 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 20 Apr 2010 16:53:30 +0000 (17:53 +0100)
webstump/scripts/filter.lib.pl
webstump/scripts/webstump.lib.pl

index b98b22d..700920d 100644 (file)
@@ -11,7 +11,7 @@
 # Subject, newsgroup, ShortDirectoryName, decision, comment
 
 sub process_approval_decision {
-
+  my $cathow = @_>=6 ? pop(@_) : "UNKNOWN";
   my $comment = pop( @_ );
   my $decision = pop( @_ );
   my $ShortDirectoryName = pop( @_ );
@@ -28,7 +28,10 @@ sub process_approval_decision {
   $message .= "comment $comment\n" if $comment;
   &email_message( $message, $address );
 
-print STDERR "DECISION: $decision for $ShortDirectoryName sent to $address, for $newsgroup\n";
+  my $sanisubj= $Subject;
+  $sanisubj =~ s/.*\:\://;
+
+print STDERR "DECISION: $newsgroup | $ShortDirectoryName | $decision | $cathow | $sanisubj\n";
 
   &rmdir_rf( &article_file_name( $ShortDirectoryName ) );
 
@@ -86,12 +89,12 @@ sub review_incoming_message { # Newsgroup, From, Subject, RealSubject, Message,
   my $newsgroup = pop( @_ );
 
   if( &name_is_in_list( $from, "bad.posters.list" ) ) {
-    &process_approval_decision( $subject, $newsgroup, $dir, "reject abuse", "" );
+    &process_approval_decision( $subject, $newsgroup, $dir, "reject abuse", "", "auto bad poster" );
     return;
   }
 
   if( &name_is_in_list( $real_subject, "bad.subjects.list" ) ) {
-    &process_approval_decision( $subject, $newsgroup, $dir, "reject thread", "" );
+    &process_approval_decision( $subject, $newsgroup, $dir, "reject thread", "", "auto bad subject" );
     return;
   }
 
@@ -99,7 +102,8 @@ sub review_incoming_message { # Newsgroup, From, Subject, RealSubject, Message,
     &process_approval_decision( $subject, $newsgroup, $dir, "reject charter", 
     "Your message has been autorejected because it appears to be off topic
     based on our filtering criteria. Like everything, filters do not
-    always work perfectly and you can always appeal this decision." );
+    always work perfectly and you can always appeal this decision.",
+                                "auto bad word" );
     return;
   }
 
@@ -127,12 +131,14 @@ print STDERR "Filing Article for review because article matches '$match'\n";
   }
 
   if( &name_is_in_list( $from, "good.posters.list" ) ) {
-    &process_approval_decision( $subject, $newsgroup, $dir, "approve", "" );
+    &process_approval_decision( $subject, $newsgroup, $dir, "approve", "",
+                                "auto good poster" );
     return;
   }
 
   if( &name_is_in_list( $real_subject, "good.subjects.list" ) ) {
-    &process_approval_decision( $subject, $newsgroup, $dir, "approve", "" );
+    &process_approval_decision( $subject, $newsgroup, $dir, "approve", "",
+                                "auto good subject" );
     return;
   }
 
index 3baa41f..e19be93 100644 (file)
@@ -628,7 +628,7 @@ sub approval_decision {
                if $thread_decision eq "watch";
 
 # Subject, newsgroup, ShortDirectoryName, decision, comment
-        &process_approval_decision( $Subject, $newsgroup, $file, $decision, $comment );
+        &process_approval_decision( $Subject, $newsgroup, $file, $decision, $comment, "moderator \U$request{'moderator'}" );
 
       }
     }