diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-04-27 20:05:08 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-04-27 20:05:08 +0000 |
commit | 26f2dbe157bd4988d17f97d02b2e4829cc796146 (patch) | |
tree | 947b03c5bd80835c5ee1e619ac6d2839fca06e9b /packages | |
parent | e83705b9e23e3e7ecf54eb92a22130386efc83b7 (diff) | |
download | pfsense-packages-26f2dbe157bd4988d17f97d02b2e4829cc796146.tar.gz pfsense-packages-26f2dbe157bd4988d17f97d02b2e4829cc796146.tar.bz2 pfsense-packages-26f2dbe157bd4988d17f97d02b2e4829cc796146.zip |
Add ip to the whitelist table immediately after its added to pfSense
Diffstat (limited to 'packages')
-rw-r--r-- | packages/spamd_whitelist.xml | 29 |
1 files changed, 16 insertions, 13 deletions
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 @@ </fields> <custom_php_command_before_form> 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(); } </custom_php_command_before_form> <custom_delete_php_command> |