@@ -1304,6 +1304,38 @@ public function configure_dovecot() {
13041304 file_put_contents ($ config_dir .'/ ' .$ configfile ,$ content );
13051305 unset($ content );
13061306 }
1307+ if (version_compare ($ dovecot_version ,2.3 ) >= 0 ) {
1308+ // Remove deprecated setting(s)
1309+ removeLine ($ config_dir .'/ ' .$ configfile , 'ssl_protocols = ' );
1310+
1311+ // Check if we have a dhparams file and if not, create it
1312+ if (!file_exists ('/etc/dovecot/dh.pem ' )) {
1313+ swriteln ('Creating new DHParams file, this takes several minutes. Do not interrupt the script. ' );
1314+ if (file_exists ('/var/lib/dovecot/ssl-parameters.dat ' )) {
1315+ // convert existing ssl parameters file
1316+ $ command = 'dd if=/var/lib/dovecot/ssl-parameters.dat bs=1 skip=88 | openssl dhparam -inform der > /etc/dovecot/dh.pem ' ;
1317+ caselog ($ command .' &> /dev/null ' , __FILE__ , __LINE__ , "EXECUTED: $ command " , "Failed to execute the command $ command " );
1318+ } else {
1319+ /*
1320+ Create a new dhparams file. We use 2048 bit only as it simply takes too long
1321+ on smaller systems to generate a 4096 bit dh file (> 30 minutes). If you need
1322+ a 4096 bit file, create it manually before you install ISPConfig
1323+ */
1324+ $ command = 'openssl dhparam -out /etc/dovecot/dh.pem 2048 ' ;
1325+ caselog ($ command .' &> /dev/null ' , __FILE__ , __LINE__ , "EXECUTED: $ command " , "Failed to execute the command $ command " );
1326+ }
1327+ }
1328+ //remove #2.3+ comment
1329+ $ content = file_get_contents ($ config_dir .'/ ' .$ configfile );
1330+ $ content = str_replace ('#2.3+ ' ,'' ,$ content );
1331+ file_put_contents ($ config_dir .'/ ' .$ configfile ,$ content );
1332+ unset($ content );
1333+
1334+ } else {
1335+ // remove settings which are not supported in Dovecot < 2.3
1336+ removeLine ($ config_dir .'/ ' .$ configfile , 'ssl_min_protocol = ' );
1337+ removeLine ($ config_dir .'/ ' .$ configfile , 'ssl_dh = ' );
1338+ }
13071339 }
13081340
13091341 //* dovecot-lmtpd
@@ -2322,6 +2354,7 @@ public function configure_apps_vhost() {
23222354 || file_exists ('/var/run/php/php7.1-fpm.sock ' )
23232355 || file_exists ('/var/run/php/php7.2-fpm.sock ' )
23242356 || file_exists ('/var/run/php/php7.3-fpm.sock ' )
2357+ || file_exists ('/var/run/php/php7.4-fpm.sock ' )
23252358 ){
23262359 $ use_tcp = '# ' ;
23272360 $ use_socket = '' ;
@@ -2340,6 +2373,8 @@ public function configure_apps_vhost() {
23402373 if (file_exists ('/var/run/php/php7.0-fpm.sock ' )) $ content = str_replace ('/var/run/php5-fpm.sock ' , '/var/run/php/php7.0-fpm.sock ' , $ content );
23412374 if (file_exists ('/var/run/php/php7.1-fpm.sock ' )) $ content = str_replace ('/var/run/php5-fpm.sock ' , '/var/run/php/php7.1-fpm.sock ' , $ content );
23422375 if (file_exists ('/var/run/php/php7.2-fpm.sock ' )) $ content = str_replace ('/var/run/php5-fpm.sock ' , '/var/run/php/php7.2-fpm.sock ' , $ content );
2376+ if (file_exists ('/var/run/php/php7.3-fpm.sock ' )) $ content = str_replace ('/var/run/php5-fpm.sock ' , '/var/run/php/php7.3-fpm.sock ' , $ content );
2377+ if (file_exists ('/var/run/php/php7.4-fpm.sock ' )) $ content = str_replace ('/var/run/php5-fpm.sock ' , '/var/run/php/php7.4-fpm.sock ' , $ content );
23432378
23442379 wf ($ vhost_conf_dir .'/apps.vhost ' , $ content );
23452380
0 commit comments