diff options
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(); } |