From c50750194eb86db794381c5b743c3355056bd933 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Mon, 20 Mar 2006 04:19:53 +0000 Subject: Read in email spamtrap file and do not process already spamtrapped email addresses --- packages/spamd_verify_to_address.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'packages') diff --git a/packages/spamd_verify_to_address.php b/packages/spamd_verify_to_address.php index 6da3336e..5fa4a2ca 100644 --- a/packages/spamd_verify_to_address.php +++ b/packages/spamd_verify_to_address.php @@ -66,7 +66,10 @@ if($debug) { echo "VALID: ||$valid||\n"; } +/* suck custom blacklist into array */ $current_blacklist = split("\n", `cat /var/db/blacklist.txt`); +/* suck current spamtrap emails into array */ +$current_spamtrap = split("\n", `/usr/local/sbin/spamdb | grep SPAMTRAP | cut -d"|" -f2`); /* traverse list and find the dictionary attackers, etc */ foreach($grey_hosts as $grey) { @@ -85,6 +88,11 @@ foreach($grey_hosts as $grey) { echo "$server_ip already in blacklist.\n"; continue; } + if(in_array($email_to, $current_spamtrap)) { + if($email_to) + echo "$email_to already in blacklist.\n"; + continue; + } if($debug) echo "Testing $email_from | $email_to \n"; if (in_array($email_to, $valid_list)) { @@ -115,10 +123,11 @@ foreach($grey_hosts as $grey) { mwexec("killall -HUP spamlogd"); if($debug) { + echo "\nSearch completed.\n\n"; echo "Items trapped: "; - system("spamdb | grep TRAPPED | wc -l"); + system("/usr/local/sbin/spamdb | grep TRAPPED | wc -l"); echo "Items spamtrapped: "; - system("spamdb | grep SPAMTRAP | wc -l"); + system("/usr/local/sbin/spamdb | grep SPAMTRAP | wc -l"); } mwexec("/sbin/pfctl -q -t blacklist -T replace -f /var/db/blacklist.txt"); -- cgit v1.2.3