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/spamd_db_ext.php | |
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/spamd_db_ext.php')
-rw-r--r-- | packages/spamd_db_ext.php | 9 |
1 files changed, 7 insertions, 2 deletions
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(); } |