diff --git a/install/dist/lib/debian60.lib.php b/install/dist/lib/debian60.lib.php index 487d3505125941c7d23ad56a958c3b3e616b274b..cc234f132e1fb4a66f4d7e5a1b13866617f4bd88 100644 --- a/install/dist/lib/debian60.lib.php +++ b/install/dist/lib/debian60.lib.php @@ -136,6 +136,12 @@ class installer extends installer_base { caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); } } + //remove #2.3+ comment + $content = file_get_contents($config_dir.'/'.$configfile); + $content = str_replace('#2.3+','',$content); + file_put_contents($config_dir.'/'.$configfile,$content); + unset($content); + } else { // remove settings which are not supported in Dovecot < 2.3 removeLine($config_dir.'/'.$configfile, 'ssl_min_protocol ='); diff --git a/install/dist/lib/fedora.lib.php b/install/dist/lib/fedora.lib.php index 5bb8fc0d2566b0dbf0006f384580c31131d37b23..3af8746908c796967f118a82f83dffda675667f2 100644 --- a/install/dist/lib/fedora.lib.php +++ b/install/dist/lib/fedora.lib.php @@ -449,6 +449,38 @@ class installer_dist extends installer_base { file_put_contents($config_dir.'/'.$configfile,$content); unset($content); } + if(version_compare($dovecot_version,2.3) >= 0) { + // Remove deprecated setting(s) + removeLine($config_dir.'/'.$configfile, 'ssl_protocols ='); + + // Check if we have a dhparams file and if not, create it + if(!file_exists('/etc/dovecot/dh.pem')) { + swriteln('Creating new DHParams file, this takes several minutes. Do not interrupt the script.'); + if(file_exists('/var/lib/dovecot/ssl-parameters.dat')) { + // convert existing ssl parameters file + $command = 'dd if=/var/lib/dovecot/ssl-parameters.dat bs=1 skip=88 | openssl dhparam -inform der > /etc/dovecot/dh.pem'; + caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + } else { + /* + Create a new dhparams file. We use 2048 bit only as it simply takes too long + on smaller systems to generate a 4096 bit dh file (> 30 minutes). If you need + a 4096 bit file, create it manually before you install ISPConfig + */ + $command = 'openssl dhparam -out /etc/dovecot/dh.pem 2048'; + caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + } + } + //remove #2.3+ comment + $content = file_get_contents($config_dir.'/'.$configfile); + $content = str_replace('#2.3+','',$content); + file_put_contents($config_dir.'/'.$configfile,$content); + unset($content); + + } else { + // remove settings which are not supported in Dovecot < 2.3 + removeLine($config_dir.'/'.$configfile, 'ssl_min_protocol ='); + removeLine($config_dir.'/'.$configfile, 'ssl_dh ='); + } replaceLine($config_dir.'/'.$configfile, 'postmaster_address = postmaster@example.com', 'postmaster_address = postmaster@'.$conf['hostname'], 1, 0); replaceLine($config_dir.'/'.$configfile, 'postmaster_address = webmaster@localhost', 'postmaster_address = postmaster@'.$conf['hostname'], 1, 0); } else { diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php index 148c6708b898dcb287a56d5746edb7d2f624898a..dd4fe9c306080acb7f08972f20355f91e7b311c4 100644 --- a/install/lib/installer_base.lib.php +++ b/install/lib/installer_base.lib.php @@ -1304,6 +1304,38 @@ class installer_base { file_put_contents($config_dir.'/'.$configfile,$content); unset($content); } + if(version_compare($dovecot_version,2.3) >= 0) { + // Remove deprecated setting(s) + removeLine($config_dir.'/'.$configfile, 'ssl_protocols ='); + + // Check if we have a dhparams file and if not, create it + if(!file_exists('/etc/dovecot/dh.pem')) { + swriteln('Creating new DHParams file, this takes several minutes. Do not interrupt the script.'); + if(file_exists('/var/lib/dovecot/ssl-parameters.dat')) { + // convert existing ssl parameters file + $command = 'dd if=/var/lib/dovecot/ssl-parameters.dat bs=1 skip=88 | openssl dhparam -inform der > /etc/dovecot/dh.pem'; + caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + } else { + /* + Create a new dhparams file. We use 2048 bit only as it simply takes too long + on smaller systems to generate a 4096 bit dh file (> 30 minutes). If you need + a 4096 bit file, create it manually before you install ISPConfig + */ + $command = 'openssl dhparam -out /etc/dovecot/dh.pem 2048'; + caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + } + } + //remove #2.3+ comment + $content = file_get_contents($config_dir.'/'.$configfile); + $content = str_replace('#2.3+','',$content); + file_put_contents($config_dir.'/'.$configfile,$content); + unset($content); + + } else { + // remove settings which are not supported in Dovecot < 2.3 + removeLine($config_dir.'/'.$configfile, 'ssl_min_protocol ='); + removeLine($config_dir.'/'.$configfile, 'ssl_dh ='); + } } //* dovecot-lmtpd diff --git a/install/tpl/debian6_dovecot2.conf.master b/install/tpl/debian6_dovecot2.conf.master index f13bbd53df2bf874d8203f63d3248939a41ae226..74f680024ba26f84db2829c359639531d870256b 100644 --- a/install/tpl/debian6_dovecot2.conf.master +++ b/install/tpl/debian6_dovecot2.conf.master @@ -68,3 +68,20 @@ protocol lmtp { postmaster_address = webmaster@localhost mail_plugins = quota sieve } + +mail_plugins = $mail_plugins quota + +#2.3+ service stats { +#2.3+ unix_listener stats-reader { +#2.3+ user = vmail +#2.3+ group = vmail +#2.3+ mode = 0660 +#2.3+ } +#2.3+ +#2.3+ unix_listener stats-writer { +#2.3+ user = vmail +#2.3+ group = vmail +#2.3+ mode = 0660 +#2.3+ } +#2.3+ } + diff --git a/install/tpl/debian_dovecot2.conf.master b/install/tpl/debian_dovecot2.conf.master index 8fdaf44eeb7bc156eb27c43dc113dd182bb21616..cfe3bd018297a88206ca6f2a8854cbb26aae7c55 100644 --- a/install/tpl/debian_dovecot2.conf.master +++ b/install/tpl/debian_dovecot2.conf.master @@ -64,4 +64,19 @@ protocol lmtp { postmaster_address = webmaster@localhost mail_plugins = quota sieve } + mail_plugins = $mail_plugins quota + +#2.3+ service stats { +#2.3+ unix_listener stats-reader { +#2.3+ user = vmail +#2.3+ group = vmail +#2.3+ mode = 0660 +#2.3+ } +#2.3+ +#2.3+ unix_listener stats-writer { +#2.3+ user = vmail +#2.3+ group = vmail +#2.3+ mode = 0660 +#2.3+ } +#2.3+ } diff --git a/install/tpl/fedora_dovecot2.conf.master b/install/tpl/fedora_dovecot2.conf.master index c14af1d44d505dbcdf15a00d2e2b471c80a6f3d6..1ba39a30d49c231b3d30b1c0f32ca51aff51b63f 100644 --- a/install/tpl/fedora_dovecot2.conf.master +++ b/install/tpl/fedora_dovecot2.conf.master @@ -61,4 +61,19 @@ protocol lmtp { postmaster_address = webmaster@localhost mail_plugins = quota sieve } + mail_plugins = $mail_plugins quota + +#2.3+ service stats { +#2.3+ unix_listener stats-reader { +#2.3+ user = vmail +#2.3+ group = vmail +#2.3+ mode = 0660 +#2.3+ } +#2.3+ +#2.3+ unix_listener stats-writer { +#2.3+ user = vmail +#2.3+ group = vmail +#2.3+ mode = 0660 +#2.3+ } +#2.3+ } diff --git a/install/tpl/opensuse_dovecot2.conf.master b/install/tpl/opensuse_dovecot2.conf.master index f28c1095d2792989b09e64e3fa3f403c2adca09c..f615cf335494ef1307706d9a3a1a55adf6228218 100644 --- a/install/tpl/opensuse_dovecot2.conf.master +++ b/install/tpl/opensuse_dovecot2.conf.master @@ -60,4 +60,19 @@ protocol lmtp { postmaster_address = webmaster@localhost mail_plugins = quota sieve } + mail_plugins = $mail_plugins quota + +#2.3+ service stats { +#2.3+ unix_listener stats-reader { +#2.3+ user = vmail +#2.3+ group = vmail +#2.3+ mode = 0660 +#2.3+ } +#2.3+ +#2.3+ unix_listener stats-writer { +#2.3+ user = vmail +#2.3+ group = vmail +#2.3+ mode = 0660 +#2.3+ } +#2.3+ }