diff options
Diffstat (limited to 'config/spamd/spamd.inc')
-rw-r--r-- | config/spamd/spamd.inc | 19 |
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; |