diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2008-07-14 22:11:44 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2008-07-14 22:11:44 +0000 |
commit | 5c333f63c704b63e44710e02cf608890bd4c78ae (patch) | |
tree | 3d22fbbc5266b5c524a5a2d0c37370a0d9da1a89 /packages | |
parent | 3e577be9efbe5716077bb15234f82a2b2cb188b5 (diff) | |
download | pfsense-packages-5c333f63c704b63e44710e02cf608890bd4c78ae.tar.gz pfsense-packages-5c333f63c704b63e44710e02cf608890bd4c78ae.tar.bz2 pfsense-packages-5c333f63c704b63e44710e02cf608890bd4c78ae.zip |
Correct spamtrap to addresses.
Diffstat (limited to 'packages')
-rw-r--r-- | packages/spamd_db.php | 20 |
1 files changed, 10 insertions, 10 deletions
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 = "<NOBR><a href='javascript:toggle_on(\"w{$rows}\", \"/themes/{$g['theme']}/images/icons/icon_plus_p.gif\"); getURL(\"spamd_db.php?buttonid=w{$rows}&srcip={$srcip}&action=whitelist\", outputrule);'><img title=\"Add to whitelist\" name='w{$rows}' id='w{$rows}' border=\"0\" alt=\"Add to whitelist\" src=\"/themes/{$g['theme']}/images/icons/icon_plus.gif\"></a> "; $rowtext .= "<a href='javascript:toggle_on(\"b{$rows}\", \"/themes/{$g['theme']}/images/icons/icon_trapped_p.gif\");getURL(\"spamd_db.php?buttonid=b{$rows}&srcip={$srcip}&action=trapped\", outputrule);'><img title=\"Blacklist\" name='b{$rows}' id='b{$rows}' border=\"0\" alt=\"Blacklist\" src=\"/themes/{$g['theme']}/images/icons/icon_trapped.gif\"></a> "; $rowtext .= "<a href='javascript:toggle_on(\"d{$rows}\", \"/themes/{$g['theme']}/images/icons/icon_x_p.gif\");getURL(\"spamd_db.php?buttonid=d{$rows}&srcip={$srcip}&action=delete\", outputrule);'><img title=\"Delete\" border=\"0\" name='d{$rows}' id='d{$rows}' alt=\"Delete\" src=\"./themes/{$g['theme']}/images/icons/icon_x.gif\"></a>"; - $rowtext .= "<a href='javascript:delete_row_db(\"{$rows}\"); toggle_on(\"s{$rows}\", \"/themes/{$g['theme']}/images/icons/icon_plus_bl_p.gif\");getURL(\"spamd_db.php?buttonid=s{$rows}&srcip={$srcip}&action=spamtrap\", outputrule);'><img title=\"Spamtrap\" name='s{$rows}' id='s{$rows}' border=\"0\" alt=\"Spamtrap\" src=\"./themes/{$g['theme']}/images/icons/icon_plus_bl.gif\"></a> "; - echo $rowtext; + $rowtext .= "<a href='javascript:delete_row_db(\"{$rows}\"); toggle_on(\"s{$rows}\", \"/themes/{$g['theme']}/images/icons/icon_plus_bl_p.gif\");getURL(\"spamd_db.php?buttonid=s{$rows}&toaddress={$toaddress}&action=spamtrap\", outputrule);'><img title=\"Spamtrap\" name='s{$rows}' id='s{$rows}' border=\"0\" alt=\"Spamtrap\" src=\"./themes/{$g['theme']}/images/icons/icon_plus_bl.gif\"></a> "; + if($lasttext <> $rowtext) + echo $rowtext; + $lasttext = $rowtext; echo "</td></tr>"; $rows++; |