Skip to content

Commit 90ce11e

Browse files
author
Till Brehm
committed
Improved dovecot config file editing.
1 parent 812e8df commit 90ce11e

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

install/dist/lib/debian60.lib.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,10 @@ public function configure_dovecot()
111111
}
112112
if(version_compare($dovecot_version,2.2) >= 0) {
113113
// Dovecot > 2.2 does not recognize !SSLv2 anymore on Debian 9
114-
replaceLine($config_dir.'/'.$configfile, 'ssl_protocols = !SSLv2 !SSLv3', 'ssl_protocols = !SSLv3', 1, 0);
114+
$content = file_get_contents($config_dir.'/'.$configfile);
115+
$content = str_replace('!SSLv2','',$content);
116+
file_put_contents($config_dir.'/'.$configfile,$content);
117+
unset($content);
115118
}
116119
} else {
117120
if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/debian6_dovecot.conf.master')) {

install/dist/lib/fedora.lib.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,13 @@ public function configure_dovecot()
443443
if(version_compare($dovecot_version,2.1) < 0) {
444444
removeLine($config_dir.'/'.$configfile, 'ssl_protocols =');
445445
}
446+
if(version_compare($dovecot_version,2.2) >= 0) {
447+
// Dovecot > 2.2 does not recognize !SSLv2 anymore on Debian 9
448+
$content = file_get_contents($config_dir.'/'.$configfile);
449+
$content = str_replace('!SSLv2','',$content);
450+
file_put_contents($config_dir.'/'.$configfile,$content);
451+
unset($content);
452+
}
446453
replaceLine($config_dir.'/'.$configfile, 'postmaster_address = postmaster@example.com', 'postmaster_address = postmaster@'.$conf['hostname'], 1, 0);
447454
replaceLine($config_dir.'/'.$configfile, 'postmaster_address = webmaster@localhost', 'postmaster_address = postmaster@'.$conf['hostname'], 1, 0);
448455
} else {

install/lib/installer_base.lib.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1292,7 +1292,10 @@ public function configure_dovecot() {
12921292
}
12931293
if(version_compare($dovecot_version,2.2) >= 0) {
12941294
// Dovecot > 2.2 does not recognize !SSLv2 anymore on Debian 9
1295-
replaceLine($config_dir.'/'.$configfile, 'ssl_protocols = !SSLv2 !SSLv3', 'ssl_protocols = !SSLv3', 1, 0);
1295+
$content = file_get_contents($config_dir.'/'.$configfile);
1296+
$content = str_replace('!SSLv2','',$content);
1297+
file_put_contents($config_dir.'/'.$configfile,$content);
1298+
unset($content);
12961299
}
12971300
}
12981301

0 commit comments

Comments
 (0)