Skip to content

Commit

Permalink
[config-services] add validation for empty or non-existing configurat…
Browse files Browse the repository at this point in the history
…ion template xml files; [php-fpm] remove 'date.timezone' from php_admin_values (superfluous as it is in php_values); [antispam] set rewrite_subject to a slighty higher score then used for add_header, fixes #1275

Signed-off-by: Michael Kaufmann <[email protected]>
  • Loading branch information
d00p committed Sep 10, 2024
1 parent 1fd8b88 commit c69b38b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 0 additions & 1 deletion install/froxlor.sql.php
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,6 @@
opcache.use_cwd
opcache.fast_shutdown'),
('phpfpm', 'ini_admin_values', 'cgi.redirect_status_env
date.timezone
disable_classes
disable_functions
error_log
Expand Down
11 changes: 10 additions & 1 deletion lib/Froxlor/Cli/ConfigServices.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ private function createConfig(OutputInterface $output, SymfonyStyle $io): int
$_daemons_config['distro'] = $io->choice('Choose distribution', $valid_dists, $os_default);

// go through all services and let user check whether to include it or not
if (empty($_daemons_config['distro']) || !file_exists($config_dir . '/' . $_daemons_config['distro']. ".xml")) {
$output->writeln('<error>Empty or non-existing distribution given.</>');
return self::INVALID;
}
$configfiles = new ConfigParser($config_dir . '/' . $_daemons_config['distro'] . ".xml");
$services = $configfiles->getServices();

Expand Down Expand Up @@ -352,8 +356,13 @@ private function applyConfig(InputInterface $input, OutputInterface $output, Sym
}

if (!empty($decoded_config)) {

$config_dir = Froxlor::getInstallDir() . 'lib/configfiles/';
$configfiles = new ConfigParser($config_dir . '/' . $decoded_config['distro'] . ".xml");
if (empty($decoded_config['distro']) || !file_exists($config_dir . '/' . $decoded_config['distro']. ".xml")) {
$output->writeln('<error>Empty or non-existing distribution given. Please login with an admin, go to "System -> Configuration" and select your correct distribution in the top-right corner or specify valid distribution name for "distro" parameter.</>');
return self::INVALID;
}
$configfiles = new ConfigParser($config_dir . '/' . $decoded_config['distro']. ".xml");
$services = $configfiles->getServices();
$replace_arr = $this->getReplacerArray();

Expand Down
2 changes: 1 addition & 1 deletion lib/Froxlor/Cron/Mail/Rspamd.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ private function generateEmailAddrConfig(array $email): void
$this->frx_settings_file .= ' apply {' . "\n";
$this->frx_settings_file .= ' actions {' . "\n";
$this->frx_settings_file .= ' "add header" = ' . $email['spam_tag_level'] . ';' . "\n";
$this->frx_settings_file .= ' rewrite_subject = ' . $email['spam_tag_level'] . ';' . "\n";
$this->frx_settings_file .= ' rewrite_subject = ' . ($email['spam_tag_level'] + 0.01) . ';' . "\n";
$this->frx_settings_file .= ' reject = ' . $email['spam_kill_level'] . ';' . "\n";
if ($type == 'rcpt' && (int)$email['policy_greylist'] == 0) {
$this->frx_settings_file .= ' greylist = null;' . "\n";
Expand Down

0 comments on commit c69b38b

Please sign in to comment.