From 1b1b13f4118fb2561ebb3606d85cc1d43bb0b39c Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Fri, 2 Jun 2006 17:21:08 +0000 Subject: Delete from whitelist when required. --- packages/spamd_db.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'packages/spamd_db.php') diff --git a/packages/spamd_db.php b/packages/spamd_db.php index 7b138877..761e64ac 100644 --- a/packages/spamd_db.php +++ b/packages/spamd_db.php @@ -150,6 +150,21 @@ function delete_from_blacklist($srcip) { config_unlock(); } +function delete_from_whitelist($srcip) { + config_lock(); + $whitelist = split("\n", file_get_contents("/var/db/whitelist.txt")); + $fd = fopen("/var/db/whitelist.txt", "w"); + foreach($whitelist as $wl) { + if($wl <> "") + if(!stristr($wl, $srcip)) + fwrite($fd, "{$wl}\n"); + } + fclose($fd); + mwexec("/sbin/pfctl -q -t spamd -T delete $srcip"); + mwexec("/sbin/pfctl -q -t whitelist -T replace -f /var/db/whitelist.txt"); + config_unlock(); +} + $pgtitle = "SpamD: Database"; include("head.inc"); -- cgit v1.2.3