# 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;
+ chomp $item;
- next if $item =~ /^\s*$/;
+ next unless $item =~ /\S/;
+ next if $item =~ /^\s*\#/;
- my $quoted_item = quotemeta( $item );
-
- 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", "", "auto bad poster" );
+ &process_approval_decision( $subject, $newsgroup, $dir, "reject blocklist", "", "auto bad poster" );
return;
}