From 26f2dbe157bd4988d17f97d02b2e4829cc796146 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Thu, 27 Apr 2006 20:05:08 +0000 Subject: Add ip to the whitelist table immediately after its added to pfSense --- packages/spamd_whitelist.xml | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'packages') diff --git a/packages/spamd_whitelist.xml b/packages/spamd_whitelist.xml index 67b5e233..0bd787cd 100644 --- a/packages/spamd_whitelist.xml +++ b/packages/spamd_whitelist.xml @@ -64,19 +64,22 @@ function sync_package_spamd_whitelist() { - global $config; - conf_mount_rw(); - config_lock(); - $fd = fopen("/var/db/whitelist.txt","w"); - if($config['installedpackages']['spamdwhitelist']['config'] != "") - foreach($config['installedpackages']['spamdwhitelist']['config'] as $spamd) { - fwrite($fd, $spamd['ip'] . "\n"); - } - fclose($fd); - /* signal a reload of all files */ - mwexec("killall -HUP spamlogd"); - conf_mount_ro(); - config_unlock(); + global $config; + conf_mount_rw(); + config_lock(); + /* write out ip to the whitelist db */ + $fd = fopen("/var/db/whitelist.txt","w"); + if($config['installedpackages']['spamdwhitelist']['config'] != "") { + foreach($config['installedpackages']['spamdwhitelist']['config'] as $spamd) { + fwrite($fd, $spamd['ip'] . "\n"); + } + } + fclose($fd); + /* signal a reload of all files */ + mwexec("/usr/bin/killall -HUP spamlogd"); + mwexec("/sbin/pfctl -t spamd-white -T add {$spamd['ip']}"); + conf_mount_ro(); + config_unlock(); } -- cgit v1.2.3