X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=maps%2Flib%2FMAPS.pm;h=c0e3448c7c0f291dee2619a785ae8c074ed0bca6;hb=bdcd310c3621f450264f16cf4c7b347c738bf83f;hp=705196e7aa7018222e377aeca2c933e973a2b8dd;hpb=0ace35bef5b69543b6444447a7acf9bed8a9efd6;p=clearscm.git diff --git a/maps/lib/MAPS.pm b/maps/lib/MAPS.pm index 705196e..c0e3448 100644 --- a/maps/lib/MAPS.pm +++ b/maps/lib/MAPS.pm @@ -291,7 +291,7 @@ sub AddList(%) { $rec{hit_count} //= $db->count( 'email', - "userid = '$rec{userid}' and sender like '$rec{sender}%'" + "userid = '$rec{userid}' and sender like '%$rec{sender}%'" ); ($rec{pattern}, $rec{domain}) = split /\@/, delete $rec{sender}; @@ -403,6 +403,8 @@ sub CheckEmail(;$$) { if ($username) { if ($username =~ /(.*)\@(.*)/) { return lc "$1\@$2"; + } else { + return lc "$username\@"; } # if } elsif ($domain) { if ($domain =~ /(.*)\@(.*)/) { @@ -458,7 +460,9 @@ sub CheckOnList ($$;$) { ? "$email_on_file\@" : $email_on_file; if ($sender and $sender =~ /$search_for/i) { - $rule = "Matching rule: ($listtype:$rec->{sequence}) \"$email_on_file\""; + my $comment = $rec->{comment} ? " - $rec->{comment}" : ''; + + $rule = "Matching rule: ($listtype:$rec->{sequence}) \"$email_on_file$comment\""; $rule .= " - $rec->{comment}" if $rec->{comment}; $status = 1; @@ -1013,7 +1017,7 @@ sub ResequenceList(%) { $db->lock('write', $table); # Get all records for $userid and $type - my $listrecs = $db->get($table, $condition); + my $listrecs = $db->get($table, $condition,'*', 'order by hit_count desc'); # Delete all of the list entries for this $userid and $type my ($count, $msg) = $db->delete($table, $condition);