Skip to content

Commit eae2368

Browse files
author
Till Brehm
committed
Fixed #5340 Debian 10 warnings about deprecated dovecot config and missing dh params file.
1 parent 7aa9c37 commit eae2368

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

install/dist/lib/debian60.lib.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,32 @@ public function configure_dovecot()
116116
file_put_contents($config_dir.'/'.$configfile,$content);
117117
unset($content);
118118
}
119+
if(version_compare($dovecot_version,2.3) >= 0) {
120+
// Remove deprecated setting(s)
121+
removeLine($config_dir.'/'.$configfile, 'ssl_protocols =');
122+
123+
// Check if we have a dhparams file and if not, create it
124+
if(!file_exists('/etc/dovecot/dh.pem')) {
125+
swriteln('Creating new DHParams file, this takes several minutes. Do not interrupt the script.');
126+
if(file_exists('/var/lib/dovecot/ssl-parameters.dat')) {
127+
// convert existing ssl parameters file
128+
$command = 'dd if=/var/lib/dovecot/ssl-parameters.dat bs=1 skip=88 | openssl dhparam -inform der > /etc/dovecot/dh.pem';
129+
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
130+
} else {
131+
/*
132+
Create a new dhparams file. We use 2048 bit only as it simply takes too long
133+
on smaller systems to generate a 4096 bit dh file (> 30 minutes). If you need
134+
a 4096 bit file, create it manually before you install ISPConfig
135+
*/
136+
$command = 'openssl dhparam -out /etc/dovecot/dh.pem 2048';
137+
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
138+
}
139+
}
140+
} else {
141+
// remove settings which are not supported in Dovecot < 2.3
142+
removeLine($config_dir.'/'.$configfile, 'ssl_min_protocol =');
143+
removeLine($config_dir.'/'.$configfile, 'ssl_dh =');
144+
}
119145
} else {
120146
if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/debian6_dovecot.conf.master')) {
121147
copy($conf['ispconfig_install_dir'].'/server/conf-custom/install/debian6_dovecot.conf.master', $config_dir.'/'.$configfile);

install/tpl/debian6_dovecot2.conf.master

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ log_timestamp = "%Y-%m-%d %H:%M:%S "
66
mail_privileged_group = vmail
77
ssl_cert = </etc/postfix/smtpd.cert
88
ssl_key = </etc/postfix/smtpd.key
9+
ssl_dh = </etc/dovecot/dh.pem
910
ssl_protocols = !SSLv2 !SSLv3
11+
ssl_min_protocol = TLSv1
1012
mail_max_userip_connections = 100
1113
passdb {
1214
args = /etc/dovecot/dovecot-sql.conf

0 commit comments

Comments
 (0)