diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2008-04-18 00:06:34 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2008-04-18 00:06:34 +0000 |
commit | 32025b29ed47a3e568a032e3d95bd2fe8704b788 (patch) | |
tree | d1cdc204cf91c4241637a54906feb643013c8b8d /packages/spamd.inc | |
parent | 95c99f1d91f168d9560d8352c2dd4eb8b12311ce (diff) | |
download | pfsense-packages-32025b29ed47a3e568a032e3d95bd2fe8704b788.tar.gz pfsense-packages-32025b29ed47a3e568a032e3d95bd2fe8704b788.tar.bz2 pfsense-packages-32025b29ed47a3e568a032e3d95bd2fe8704b788.zip |
* Woops, aliases use $ instead of {} mojo.
* Only process items if a name is provided ignoring blank entries
Diffstat (limited to 'packages/spamd.inc')
-rw-r--r-- | packages/spamd.inc | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/packages/spamd.inc b/packages/spamd.inc index c6846507..28ebe603 100644 --- a/packages/spamd.inc +++ b/packages/spamd.inc @@ -38,7 +38,9 @@ function sync_package_spamd() { fwrite($fd, "all:\\\n\t:whitelist:blacklist"); if($config['installedpackages']['spamdsources']['config']) { foreach($config['installedpackages']['spamdsources']['config'] as $spamd) { - fwrite($fd, ":" . remove_spaces($spamd['providername'])); + if($spamd['providername']) { + fwrite($fd, ":" . remove_spaces($spamd['providername'])); + } } } fwrite($fd, ":\n\n"); @@ -56,23 +58,27 @@ function sync_package_spamd() { if($config['installedpackages']['spamdsources']['config'] != "") { foreach($config['installedpackages']['spamdsources']['config'] as $spamd) { if(remove_spaces($spamd['providername'])) { - fwrite($fd, remove_spaces($spamd['providername']) . ":\\\n"); - fwrite($fd, "\t:" . remove_spaces($spamd['providertype']) . ":\\\n"); - fwrite($fd, "\t:msg=\"" . rtrim($spamd['rejectmessage']) . "\":\\\n"); - fwrite($fd, "\t:method=" . remove_spaces($spamd['providermethod']) . ":\\\n"); - fwrite($fd, "\t:" . remove_spaces($spamd['providermethod']) . ":\\\n"); - $providerurl = $spamd['providerurl']; - $providerurl = str_replace("http://", "", $providerurl); - $providerurl = str_replace("https://", "", $providerurl); - fwrite($fd, "\t:file=" . remove_spaces($providerurl) . ":\n\n"); + if($spamd['providername']) { + fwrite($fd, remove_spaces($spamd['providername']) . ":\\\n"); + fwrite($fd, "\t:" . remove_spaces($spamd['providertype']) . ":\\\n"); + fwrite($fd, "\t:msg=\"" . rtrim($spamd['rejectmessage']) . "\":\\\n"); + fwrite($fd, "\t:method=" . remove_spaces($spamd['providermethod']) . ":\\\n"); + fwrite($fd, "\t:" . remove_spaces($spamd['providermethod']) . ":\\\n"); + $providerurl = $spamd['providerurl']; + $providerurl = str_replace("http://", "", $providerurl); + $providerurl = str_replace("https://", "", $providerurl); + fwrite($fd, "\t:file=" . remove_spaces($providerurl) . ":\n\n"); + } } } } fclose($fd); $fd = fopen("/var/db/whitelist.txt","w"); - if($config['installedpackages']['spamdwhitelist']['config'] != "") + if($config['installedpackages']['spamdwhitelist']['config'] != "") { foreach($config['installedpackages']['spamdwhitelist']['config'] as $spamd) { - fwrite($fd, $spamd['ip'] . "\n"); + if($spamd['ip']) + fwrite($fd, $spamd['ip'] . "\n"); + } } fclose($fd); $passtime = "5"; @@ -249,11 +255,10 @@ function spamd_install_cron($should_install) { function spamd_validate_input($post, $input_errors) { global $config, $g; - $nextmta = $post['nextmta']; + $nextmta = str_replace("$", "", $post['nextmta']); if(stristr($nextmta, "{")) { /* item is an alias, make sure the name exists */ - $nextmta = str_replace("{", "", $nextmta); - $nextmta = str_replace("}", "", $nextmta); + $nextmta = str_replace("$", "", $nextmta); $found = false; if($config['aliases']['alias']) { foreach($config['aliases']['alias'] as $alias) { |