aboutsummaryrefslogtreecommitdiffstats
path: root/config/spamd/spamd.inc
diff options
context:
space:
mode:
authorErik Fonnesbeck <efonnes@gmail.com>2011-03-22 22:55:41 -0600
committerErik Fonnesbeck <efonnes@gmail.com>2011-03-22 22:55:41 -0600
commit7ed9e31909834e43582bfaf6263d7337ebc7f25c (patch)
tree8216b2bed9e09bf75d57ccb0c21d2cacb24b9d07 /config/spamd/spamd.inc
parent0a036c80eef23fd483a6682b4dc0b4a89d0331d5 (diff)
downloadpfsense-packages-7ed9e31909834e43582bfaf6263d7337ebc7f25c.tar.gz
pfsense-packages-7ed9e31909834e43582bfaf6263d7337ebc7f25c.tar.bz2
pfsense-packages-7ed9e31909834e43582bfaf6263d7337ebc7f25c.zip
Move sync_package_spamd_whitelist() to spamd.inc and have spamd_whitelist.xml include spamd.inc to prevent an error that says it is undefined. May help with the issue reported for ticket #1363
Diffstat (limited to 'config/spamd/spamd.inc')
-rw-r--r--config/spamd/spamd.inc19
1 files changed, 19 insertions, 0 deletions
diff --git a/config/spamd/spamd.inc b/config/spamd/spamd.inc
index 256ec08b..18b4e241 100644
--- a/config/spamd/spamd.inc
+++ b/config/spamd/spamd.inc
@@ -165,6 +165,25 @@ function sync_package_spamd() {
log_error("SpamD setup completed");
}
+function sync_package_spamd_whitelist() {
+ 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();
+}
+
function spamd_generate_rules($type) {
global $config;