# Subject, newsgroup, ShortDirectoryName, decision, comment
sub process_approval_decision {
-
+ my $cathow = @_>=6 ? pop(@_) : "UNKNOWN";
my $comment = pop( @_ );
my $decision = pop( @_ );
my $ShortDirectoryName = pop( @_ );
my $newsgroup = pop( @_ );
my $Subject = pop( @_ );
+ my $now = time;
my $address = $newsgroups_index{$newsgroup};
$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 | $now | $sanisubj\n";
&rmdir_rf( &article_file_name( $ShortDirectoryName ) );
# against the substrings as regexps and substrings as literal substrings.
#
# Arguments: address, listname
+
sub name_is_in_list { # address, listname
my $listName = pop( @_ );
my $address = pop( @_ );
my $item = "";
my $Result = "";
- $address = "\L$address";
-
open( LIST, &full_config_file_name( $listName ) ) || return "";
while( $item = <LIST> ) {
- chop $item;
-
- next if $item =~ /^\s*$/;
+ chomp $item;
- my $quoted_item = quotemeta( $item );
+ next unless $item =~ /\S/;
+ next if $item =~ /^\s*\#/;
- if( eval { $address =~ /$item/i; } || $address =~ /$quoted_item/i ) {
- $Result = $item;
+ if ($listName eq 'good.posters.list') {
+ if( lc $address eq lc $item ) {
+ $Result = $item;
+ }
+ } else {
+ if( eval { $address =~ /$item/i; } ) {
+ $Result = $item;
+ }
}
}
return $Result;
}
-
######################################################################
# reviews incoming message and decides: approve, reject, keep
# in queue for human review
my $newsgroup = pop( @_ );
if( &name_is_in_list( $from, "bad.posters.list" ) ) {
- &process_approval_decision( $subject, $newsgroup, $dir, "reject abuse", "" );
- return;
- }
-
- if( &name_is_in_list( $real_subject, "bad.subjects.list" ) ) {
- &process_approval_decision( $subject, $newsgroup, $dir, "reject thread", "" );
- return;
- }
-
- if( &name_is_in_list( $message, "bad.words.list" ) ) {
- &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." );
+ &process_approval_decision( $subject, $newsgroup, $dir, "reject blocklist", "", "auto bad poster" );
return;
}
return; # file message
}
- if( $match = &name_is_in_list( $real_subject, "watch.subjects.list" ) ) {
- &append_to_file( $warning_file, "Warning: subject '$real_subject' matches '$match' from the list of suspicious subjects\n" );
-print STDERR "Filing Article for review because subject '$subject' matches '$match'\n";
- return; # file message
- }
-
if( $match = &name_is_in_list( $message, "watch.words.list" ) ) {
&append_to_file( $warning_file, "Warning: article matches '$match' from the list of suspicious words\n" );
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", "" );
- 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 poster" );
return;
}