From b7ece9f9b89aec0fa427ab20cf99a8c6d4205cb5 Mon Sep 17 00:00:00 2001 From: Mildred Ki'Lya Date: Wed, 27 Jun 2018 16:40:04 +0000 Subject: [PATCH] roundcube: fix host parametrization Roundcube can be parametrized so it can take a different hostname than 'front' or 'imap' to connect to the mail servers through environment variables. Unfortunately, this was not correct and in PHP a `||` operator always returns a boolean. It did not work as expected. Instead use the ternary operator `:?` that works in all cases. --- webmails/roundcube/config.inc.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/webmails/roundcube/config.inc.php b/webmails/roundcube/config.inc.php index 379b3025..603fc95b 100644 --- a/webmails/roundcube/config.inc.php +++ b/webmails/roundcube/config.inc.php @@ -18,16 +18,19 @@ $config['plugins'] = array( 'enigma' ); +$front = getenv('FRONT_ADDRESS') ? getenv('FRONT_ADDRESS') : 'front'; +$imap = getenv('IMAP_ADDRESS') ? getenv('IMAP_ADDRESS') : 'imap'; + // Mail servers -$config['default_host'] = getenv('FRONT_ADDRESS') || 'front'; +$config['default_host'] = $front; $config['default_port'] = 10143; -$config['smtp_server'] = getenv('FRONT_ADDRESS') || 'front'; +$config['smtp_server'] = $front; $config['smtp_port'] = 10025; $config['smtp_user'] = '%u'; $config['smtp_pass'] = '%p'; // Sieve script management -$config['managesieve_host'] = getenv('IMAP_ADDRESS') || 'imap'; +$config['managesieve_host'] = $imap; $config['managesieve_usetls'] = false; // We access the IMAP and SMTP servers locally with internal names, SSL