Skip to content

Commit b79f6ca

Browse files
author
Till Brehm
committed
Improved dovecot version detection in installer for Fedora and CentOS.
1 parent 1fc360d commit b79f6ca

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

install/dist/lib/fedora.lib.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -416,18 +416,19 @@ public function configure_dovecot()
416416

417417
//* Get the dovecot version
418418
exec('dovecot --version', $tmp);
419-
$parts = explode('.', trim($tmp[0]));
420-
$dovecot_version = $parts[0];
419+
$dovecot_version = $tmp[0];
421420
unset($tmp);
422-
unset($parts);
423421

424422
//* Copy dovecot configuration file
425-
if($dovecot_version == 2) {
423+
if(version_compare($dovecot_version,2) >= 0) {
426424
if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/fedora_dovecot2.conf.master')) {
427425
copy($conf['ispconfig_install_dir'].'/server/conf-custom/install/fedora_dovecot2.conf.master', $config_dir.'/'.$configfile);
428426
} else {
429427
copy('tpl/fedora_dovecot2.conf.master', $config_dir.'/'.$configfile);
430428
}
429+
if(version_compare($dovecot_version,2.1) < 0) {
430+
removeLine($config_dir.'/'.$configfile, 'ssl_protocols =');
431+
}
431432
} else {
432433
if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/fedora_dovecot.conf.master')) {
433434
copy($conf['ispconfig_install_dir'].'/server/conf-custom/install/fedora_dovecot.conf.master', $config_dir.'/'.$configfile);

0 commit comments

Comments
 (0)