X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=maps%2Fbin%2FMAPS.pm;h=babf46b2f819adeb6a844d9eb7101fdd91a7629e;hb=9f51fc95d361092058a17611614f31318a3fad0c;hp=1c85e83c5bbdbb32f68e623542340b78b08422be;hpb=8dc4fbdb6ca710c7667dda9f6b7b1acac663bbfc;p=clearscm.git diff --git a/maps/bin/MAPS.pm b/maps/bin/MAPS.pm index 1c85e83..babf46b 100644 --- a/maps/bin/MAPS.pm +++ b/maps/bin/MAPS.pm @@ -139,8 +139,8 @@ sub UserExists; sub Whitelist; BEGIN { - my $MAPS_username = "mapsadmin"; - my $MAPS_password = "mapsadmin"; + my $MAPS_username = "maps"; + my $MAPS_password = "spam"; OpenDB $MAPS_username, $MAPS_password; } # BEGIN @@ -169,15 +169,15 @@ sub Add2Blacklist { Info "Removed $count emails from $sender" } # Add2Blacklist -sub Add2Nulllist ($$;$) { +sub Add2Nulllist ($$;$$) { # Add2Nulllist will add an entry to the nulllist - my ($sender, $userid, $comment) = @_; + my ($sender, $userid, $comment, $hit_count) = @_; # First SetContext to the userid whose null list we are adding to MAPSDB::SetContext $userid; # Add to null list - AddList "null", $sender, 0, $comment; + AddList "null", $sender, 0, $comment, $hit_count; # Log that we null listed the sender Info "Added $sender to " . ucfirst $userid . "'s null list"; @@ -242,10 +242,12 @@ sub AddEmail ($$$) { MAPSDB::AddEmail $sender, $subject, $data; } # AddEmail -sub AddList ($$$;$) { - my ($listtype, $pattern, $sequence, $comment) = @_; +sub AddList ($$$;$$$) { + my ($listtype, $pattern, $sequence, $comment, $hit_count, $last_hit) = @_; + + $hit_count //= CountMsg $pattern; - MAPSDB::AddList $listtype, $pattern, $sequence, $comment, CountMsg $pattern; + MAPSDB::AddList $listtype, $pattern, $sequence, $comment, $hit_count, $last_hit; } # AddList sub AddUser ($$$$) { @@ -437,26 +439,26 @@ sub Nulllist ($;$$) { Logmsg "nulllist", $sender, "Discarded message"; } # Nulllist -sub OnBlacklist ($) { - my ($sender) = @_; +sub OnBlacklist ($;$) { + my ($sender, $update) = @_; - return CheckOnList "black", $sender; + return CheckOnList "black", $sender, $update; } # CheckOnBlacklist -sub OnNulllist ($) { - my ($sender) = @_; +sub OnNulllist ($;$) { + my ($sender, $update) = @_; - return CheckOnList "null", $sender; + return CheckOnList "null", $sender, $update; } # CheckOnNulllist -sub OnWhitelist { - my ($sender, $userid) = @_; +sub OnWhitelist ($;$$) { + my ($sender, $userid, $update) = @_; if (defined $userid) { MAPSDB::SetContext $userid; } # if - return CheckOnList "white", $sender; + return CheckOnList "white", $sender, $update; } # OnWhitelist sub OptimizeDB () { @@ -723,10 +725,10 @@ sub Space ($) { return MAPSDB::Space $userid; } # Space -sub UpdateList ($$$$$$) { - my ($userid, $type, $pattern, $domain, $comment, $sequence) = @_; +sub UpdateList ($$$$$$$) { + my ($userid, $type, $pattern, $domain, $comment, $hit_count, $sequence) = @_; - return MAPSDB::UpdateList $userid, $type, $pattern, $domain, $comment, $sequence; + return MAPSDB::UpdateList $userid, $type, $pattern, $domain, $comment, $hit_count, $sequence; } # UpdateList sub UpdateUser ($$$$) {