| | |
| | | |
| | | // check if virtual_transport must be changed |
| | | if ($this->is_update) { |
| | | $tmp = $inst->db->queryOneRecord("SELECT * FROM ".$conf["mysql"]["database"].".server WHERE server_id = ".$conf['server_id']); |
| | | $tmp = $this->db->queryOneRecord("SELECT * FROM ?? WHERE server_id = ?", $conf["mysql"]["database"] . ".server", $conf['server_id']); |
| | | $ini_array = ini_to_array(stripslashes($tmp['config'])); |
| | | // ini_array needs not to be checked, because already done in update.php -> updateDbAndIni() |
| | | |
| | |
| | | |
| | | //* 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/debian6_dovecot2.conf.master')) { |
| | | copy($conf['ispconfig_install_dir'].'/server/conf-custom/install/debian6_dovecot2.conf.master', $config_dir.'/'.$configfile); |
| | | } else { |
| | | copy('tpl/debian6_dovecot2.conf.master', $config_dir.'/'.$configfile); |
| | | } |
| | | replaceLine($config_dir.'/'.$configfile, 'postmaster_address = postmaster@example.com', 'postmaster_address = postmaster@'.$conf['hostname'], 1, 0); |
| | | 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/debian6_dovecot.conf.master')) { |
| | | copy($conf['ispconfig_install_dir'].'/server/conf-custom/install/debian6_dovecot.conf.master', $config_dir.'/'.$configfile); |
| | |
| | | copy('tpl/debian6_dovecot.conf.master', $config_dir.'/'.$configfile); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | //* dovecot-sql.conf |
| | | $configfile = 'dovecot-sql.conf'; |
| | |
| | | $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); |
| | | $content = str_replace('{mysql_server_host}', $conf['mysql']['host'], $content); |
| | | $content = str_replace('{mysql_server_port}', $conf['mysql']['port'], $content); |
| | | $content = str_replace('{server_id}', $conf['server_id'], $content); |
| | | wf($config_dir.'/'.$configfile, $content); |
| | | |