diff options
-rw-r--r-- | packages/spamd.inc | 22 | ||||
-rw-r--r-- | packages/spamd_settings.xml | 3 |
2 files changed, 23 insertions, 2 deletions
diff --git a/packages/spamd.inc b/packages/spamd.inc index 1b158414..0a17bb72 100644 --- a/packages/spamd.inc +++ b/packages/spamd.inc @@ -104,8 +104,6 @@ function sync_package_spamd() { $delaysecs = " -s " . $ss['delaysecs']; if($ss['window'] <> "") $window = " -w " . $ss['window']; -// if($ss['replysmtperror'] <> "") -// $replysmtperror = " -r " . $ss['replysmtperror']; if($ss['passtime'] <> "") $passtime = $ss['passtime']; if($ss['greyexp'] <> "") @@ -246,4 +244,24 @@ function spamd_install_cron($should_install) { } } +function spamd_validate_input($post, $input_errors) { + global $config, $g; + $nextmta = $post['nextmta']; + if(stristr($nextmta, "{")) { + /* item is an alias, make sure the name exists */ + $nextmta = str_replace("{", "", $nextmta); + $nextmta = str_replace("}", "", $nextmta); + $found = false; + if($config['aliases']['alias']) { + foreach($config['aliases']['alias'] as $alias) { + if($alias['name'] == $nextmta) { + $found = true; + } + } + } + if($found == false) + $intput_errors = "Could not locate alias named " . htmlentities($nextmta); + } +} + ?>
\ No newline at end of file diff --git a/packages/spamd_settings.xml b/packages/spamd_settings.xml index e510b146..c799a34f 100644 --- a/packages/spamd_settings.xml +++ b/packages/spamd_settings.xml @@ -183,6 +183,9 @@ <value></value> </field> </fields> + <custom_php_validation_command> + spamd_validate_input($_POST, &$input_errors); + </custom_php_validation_command> <custom_php_resync_config_command> sync_package_spamd(); </custom_php_resync_config_command> |