| | |
| | | //* Create the SSL certificate |
| | | if(AUTOINSTALL){ |
| | | $command = 'cd '.$config_dir.'; ' |
| | | ."openssl req -new -subj '/C=".$autoinstall['ssl_cert_country']."/ST=".$autoinstall['ssl_cert_state']."/L=".$autoinstall['ssl_cert_locality']."/O=".$autoinstall['ssl_cert_organisation']."/OU=".$autoinstall['ssl_cert_organisation_unit']."/CN=".$autoinstall['ssl_cert_common_name']."' -outform PEM -out smtpd.cert -newkey rsa:4096 -nodes -keyout smtpd.key -keyform PEM -days 3650 -x509"; |
| | | ."openssl req -new -subj '/C=".escapeshellcmd($autoinstall['ssl_cert_country'])."/ST=".escapeshellcmd($autoinstall['ssl_cert_state'])."/L=".escapeshellcmd($autoinstall['ssl_cert_locality'])."/O=".escapeshellcmd($autoinstall['ssl_cert_organisation'])."/OU=".escapeshellcmd($autoinstall['ssl_cert_organisation_unit'])."/CN=".escapeshellcmd($autoinstall['ssl_cert_common_name'])."' -outform PEM -out smtpd.cert -newkey rsa:4096 -nodes -keyout smtpd.key -keyform PEM -days 3650 -x509"; |
| | | } else { |
| | | $command = 'cd '.$config_dir.'; ' |
| | | ."openssl req -new -subj '/C=".escapeshellcmd($autoinstall['ssl_cert_country'])."/ST=".escapeshellcmd($autoinstall['ssl_cert_state'])."/L=".escapeshellcmd($autoinstall['ssl_cert_locality'])."/O=".escapeshellcmd($autoinstall['ssl_cert_organisation'])."/OU=".escapeshellcmd($autoinstall['ssl_cert_organisation_unit'])."/CN=".escapeshellcmd($autoinstall['ssl_cert_common_name'])."' -outform PEM -out smtpd.cert -newkey rsa:4096 -nodes -keyout smtpd.key -keyform PEM -days 3650 -x509"; |
| | | .'openssl req -new -outform PEM -out smtpd.cert -newkey rsa:4096 -nodes -keyout smtpd.key -keyform PEM -days 3650 -x509'; |
| | | } |
| | | exec($command); |
| | | |
| | |
| | | |
| | | //* Get the dovecot version |
| | | exec('dovecot --version', $tmp); |
| | | $parts = explode('.', trim($tmp[0])); |
| | | $dovecot_version = $parts[0]; |
| | | $dovecot_version = $tmp[0]; |
| | | unset($tmp); |
| | | unset($parts); |
| | | |
| | | //* Copy dovecot configuration file |
| | | if($dovecot_version == 2) { |
| | | if(version_compare($dovecot_version,2) >= 0) { |
| | | if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/fedora_dovecot2.conf.master')) { |
| | | copy($conf['ispconfig_install_dir'].'/server/conf-custom/install/fedora_dovecot2.conf.master', $config_dir.'/'.$configfile); |
| | | } else { |
| | | copy('tpl/fedora_dovecot2.conf.master', $config_dir.'/'.$configfile); |
| | | } |
| | | if(version_compare($dovecot_version,2.1) < 0) { |
| | | removeLine($config_dir.'/'.$configfile, 'ssl_protocols ='); |
| | | } |
| | | } else { |
| | | if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/fedora_dovecot.conf.master')) { |
| | |
| | | exec("chmod 600 $install_dir/server/lib/mysql_clientdb.conf"); |
| | | exec("chown root:root $install_dir/server/lib/mysql_clientdb.conf"); |
| | | } |
| | | |
| | | if(is_dir($install_dir.'/interface/invoices')) { |
| | | exec('chmod -R 770 '.escapeshellarg($install_dir.'/interface/invoices')); |
| | | exec('chown -R ispconfig:ispconfig '.escapeshellarg($install_dir.'/interface/invoices')); |
| | | } |
| | | |
| | | exec('chown -R root:root /usr/local/ispconfig/interface/ssl'); |
| | | |
| | | // TODO: FIXME: add the www-data user to the ispconfig group. This is just for testing |
| | | // and must be fixed as this will allow the apache user to read the ispconfig files. |