diff options
Diffstat (limited to 'packages/spamd_db.php')
-rw-r--r-- | packages/spamd_db.php | 15 |
1 files changed, 15 insertions, 0 deletions
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"); |