diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-06-02 17:21:08 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-06-02 17:21:08 +0000 |
commit | 1b1b13f4118fb2561ebb3606d85cc1d43bb0b39c (patch) | |
tree | 59cca1bface895110e226589604bf596ba929771 /packages/spamd_db.php | |
parent | a493fed52d1075ccaf629a0ee7aa012855b7be7a (diff) | |
download | pfsense-packages-1b1b13f4118fb2561ebb3606d85cc1d43bb0b39c.tar.gz pfsense-packages-1b1b13f4118fb2561ebb3606d85cc1d43bb0b39c.tar.bz2 pfsense-packages-1b1b13f4118fb2561ebb3606d85cc1d43bb0b39c.zip |
Delete from whitelist when required.
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"); |