diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-03-20 04:19:53 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-03-20 04:19:53 +0000 |
commit | c50750194eb86db794381c5b743c3355056bd933 (patch) | |
tree | c3c09729978d9c64b047d9cc7e18d0998061029c /packages | |
parent | 2b0003150336192d2c4dad77cdb9323d51141ebd (diff) | |
download | pfsense-packages-c50750194eb86db794381c5b743c3355056bd933.tar.gz pfsense-packages-c50750194eb86db794381c5b743c3355056bd933.tar.bz2 pfsense-packages-c50750194eb86db794381c5b743c3355056bd933.zip |
Read in email spamtrap file and do not process already spamtrapped email addresses
Diffstat (limited to 'packages')
-rw-r--r-- | packages/spamd_verify_to_address.php | 13 |
1 files changed, 11 insertions, 2 deletions
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"); |