Skip to content

Commit f812f58

Browse files
author
Marius Burkard
committed
Merge remote-tracking branch 'ispc3/stable-3.1' into rspamd
2 parents 536e907 + eae2368 commit f812f58

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

install/dist/lib/debian60.lib.php

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

install/tpl/apache_ispconfig.vhost.master

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ NameVirtualHost *:<tmpl_var name="vhost_port">
8989

9090
<IfModule mod_headers.c>
9191
# ISPConfig 3.1 currently requires unsafe-line for both scripts and styles, as well as unsafe-eval
92-
Header set Content-Security-Policy "default-src 'self' 'unsafe-inline' 'unsafe-eval'; img-src 'self' data:; object-src 'none'; upgrade-insecure-requests"
92+
<tmpl_var name="ssl_comment">Header set Content-Security-Policy "default-src 'self' 'unsafe-inline' 'unsafe-eval'; img-src 'self' data:; object-src 'none'; upgrade-insecure-requests"
9393
Header set X-Content-Type-Options: nosniff
9494
Header set X-Frame-Options: SAMEORIGIN
9595
Header set X-XSS-Protection: "1; mode=block"
96-
Header always edit Set-Cookie (.*) "$1; HTTPOnly; Secure"
96+
<tmpl_var name="ssl_comment">Header always edit Set-Cookie (.*) "$1; HTTPOnly; Secure"
9797
<IfVersion >= 2.4.7>
9898
Header setifempty Strict-Transport-Security "max-age=15768000"
9999
</IfVersion>

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)