diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-03-20 03:29:26 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-03-20 03:29:26 +0000 |
commit | 470faf7e296cb5b9d3d0b060ae76e293d417d2ca (patch) | |
tree | f72399dc325df1b5196aefff0c43ae9518548f39 /packages | |
parent | 8af676f1665a0c5a4fcff2497d36e1f1b4893a0a (diff) | |
download | pfsense-packages-470faf7e296cb5b9d3d0b060ae76e293d417d2ca.tar.gz pfsense-packages-470faf7e296cb5b9d3d0b060ae76e293d417d2ca.tar.bz2 pfsense-packages-470faf7e296cb5b9d3d0b060ae76e293d417d2ca.zip |
* Delete ips from tables during delete calls
* Replace tables if needed after deleting
Diffstat (limited to 'packages')
-rw-r--r-- | packages/spamd_db.php | 5 | ||||
-rw-r--r-- | packages/spamd_db_ext.php | 9 |
2 files changed, 11 insertions, 3 deletions
diff --git a/packages/spamd_db.php b/packages/spamd_db.php index 3189f0f5..4ce29cd8 100644 --- a/packages/spamd_db.php +++ b/packages/spamd_db.php @@ -59,13 +59,16 @@ if($_GET['action'] or $_POST['action']) { if($action == "whitelist") { 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 -d \"<{$srcip}>\" -t"); + mwexec("/sbin/pfctl -q -t blacklist -T replace -f /var/db/blacklist.txt"); exec("echo spamdb -a {$srcip} > /tmp/tmp"); exec("/usr/local/sbin/spamdb -a {$srcip}"); } else if($action == "delete") { exec("/usr/local/sbin/spamdb -d {$srcip}"); exec("/usr/local/sbin/spamdb -d \"<{$srcip}>\" -T"); exec("/usr/local/sbin/spamdb -d \"<{$srcip}>\" -t"); + mwexec("/sbin/pfctl -q -t spamd -T delete $srcip"); + mwexec("/sbin/pfctl -q -t blacklist -T replace -f /var/db/blacklist.txt"); } else if($action == "spamtrap") { exec("/usr/local/sbin/spamdb -d {$srcip}"); exec("/usr/local/sbin/spamdb -d \"<{$srcip}>\" -T"); diff --git a/packages/spamd_db_ext.php b/packages/spamd_db_ext.php index 0873df7c..ea5eb1d0 100644 --- a/packages/spamd_db_ext.php +++ b/packages/spamd_db_ext.php @@ -70,18 +70,22 @@ if($_GET['action'] or $_POST['action']) { delete_from_spamd_db($srcip); usleep(100); exec("/usr/local/sbin/spamdb -a {$srcip}"); + mwexec("/sbin/pfctl -q -t blacklist -T replace -f /var/db/blacklist.txt"); hup_spamd(); exit; } else if($action == "delete") { delete_from_spamd_db($srcip); usleep(100); hup_spamd(); + mwexec("/sbin/pfctl -q -t spamd -T delete $srcip"); + mwexec("/sbin/pfctl -q -t blacklist -T replace -f /var/db/blacklist.txt"); exit; } else if($action == "spamtrap") { delete_from_spamd_db($email); usleep(100); exec("/usr/local/sbin/spamdb -a \"<{$email}>\" -T"); hup_spamd(); + mwexec("/sbin/pfctl -q -t blacklist -T add -f /var/db/blacklist.txt"); exit; } else if($action == "trapped") { delete_from_spamd_db($srcip); @@ -157,6 +161,7 @@ function delete_from_spamd_db($srcip) { exec("/bin/chmod a+rx /tmp/execcmds"); system("/bin/sh /tmp/execcmds"); mwexec("/usr/bin/killall -HUP spamlogd"); + mwexec("/sbin/pfctl -q -t blacklist -T replace -f /var/db/blacklist.txt"); config_unlock(); } @@ -186,8 +191,8 @@ function delete_from_blacklist($srcip) { fwrite($fd, "{$srcip}\n"); } fclose($fd); - 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"); + mwexec("/sbin/pfctl -q -t spamd -T delete $srcip"); + mwexec("/sbin/pfctl -q -t blacklist -T replace -f /var/db/blacklist.txt"); config_unlock(); } |