From 5c333f63c704b63e44710e02cf608890bd4c78ae Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Mon, 14 Jul 2008 22:11:44 +0000 Subject: Correct spamtrap to addresses. --- packages/spamd_db.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'packages/spamd_db.php') diff --git a/packages/spamd_db.php b/packages/spamd_db.php index 563ed751..4c30f936 100644 --- a/packages/spamd_db.php +++ b/packages/spamd_db.php @@ -51,7 +51,9 @@ if($_GET['action'] or $_POST['action']) { if($_GET['srcip']) $srcip = escapeshellarg($_GET['srcip']); if($_POST['srcip']) - $srcip = escapeshellarg($_POST['srcip']); + $srcip = escapeshellarg($_POST['srcip']); + if($_POST['toaddress']) + $toaddress = escapeshellarg($_POST['toaddress']); $srcip = str_replace("<","",$srcip); $srcip = str_replace(">","",$srcip); $srcip = str_replace(" ","",$srcip); @@ -77,12 +79,8 @@ if($_GET['action'] or $_POST['action']) { exec("/usr/local/sbin/spamdb -d \"{$srcip}\" -t"); exec("/usr/local/sbin/spamdb -a {$srcip} -T"); } else if($action == "'trapped'") { - exec("/usr/local/sbin/spamdb -d {$srcip}"); - exec("/usr/local/sbin/spamdb -d \"{$srcip}\" -T"); - exec("/usr/local/sbin/spamdb -d \"{$srcip}\" -t"); - exec("/usr/local/sbin/spamdb -a {$srcip} -t"); - mwexec("/sbin/pfctl -q -t spamd -T add -f /var/db/blacklist.txt"); - mwexec("/sbin/pfctl -q -t blacklist -T add -f /var/db/blacklist.txt"); + exec("/usr/local/sbin/spamdb -T -d \"{$toaddress}\""); + exec("/usr/local/sbin/spamdb -T -a '{$toaddress}'"); } /* signal a reload for real time effect. */ mwexec("killall -HUP spamlogd"); @@ -128,7 +126,7 @@ if($_GET['spamtrapemail'] <> "") { exit; } -/* spam trap e-mail address */ +/* whitelist e-mail address */ if($_GET['whitelist'] <> "") { $spamtrapemail = escapeshellarg($_GET['spamtrapemail']); $status = exec("spamdb -a \"{$spamtrapemail}\""); @@ -396,8 +394,10 @@ if (typeof getURL == 'undefined') { $rowtext = "\"Add "; $rowtext .= "\"Blacklist\" "; $rowtext .= "\"Delete\""; - $rowtext .= "\"Spamtrap\" "; - echo $rowtext; + $rowtext .= "\"Spamtrap\" "; + if($lasttext <> $rowtext) + echo $rowtext; + $lasttext = $rowtext; echo ""; $rows++; -- cgit v1.2.3