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 | |
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')
-rw-r--r-- | packages/spamd.inc | 35 | ||||
-rw-r--r-- | packages/spamd_settings.xml | 2 |
2 files changed, 21 insertions, 16 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) { diff --git a/packages/spamd_settings.xml b/packages/spamd_settings.xml index c799a34f..95c343d1 100644 --- a/packages/spamd_settings.xml +++ b/packages/spamd_settings.xml @@ -171,7 +171,7 @@ <field> <fielddescr>NextMTA</fielddescr> <fieldname>nextmta</fieldname> - <description>Automatically sends messages after being processed by SpamD to IP Address. You may enter an alias if you like, simply surround it with {}. Note, if you have postfix package installed enter 127.0.0.1 here.</description> + <description>Automatically sends messages after being processed by SpamD to IP Address. You may enter an alias if you like, simply prepend $ to the alias name. example: $mailservers. Note, if you have postfix package installed enter 127.0.0.1 here.</description> <type>input</type> <value>1</value> </field> |