diff --git a/helper_scripts/mydns_to_powerdns_migration.php b/helper_scripts/mydns_to_powerdns_migration.php index ffe9e4ae86aa846d4c988990fe370d265d9193fc..25a01c5ad4009212c44a636a4cfeabe03c1e43a4 100644 --- a/helper_scripts/mydns_to_powerdns_migration.php +++ b/helper_scripts/mydns_to_powerdns_migration.php @@ -31,11 +31,28 @@ while($row2 = mysql_fetch_array($sql2)) { $file2=$row2['data']; } + + // + // Fix for 'domain.ext.' apex notation + // + $record_name_end=substr($row2['name'], -1); + if ($record_name_end==".") + { + // remove trailing dot from apex + $record_name = substr($row2['name'], 0, strlen($row2['name'])-1); + } + else + { + // add domain to make it a fqdn + $record_name = $row2['name'] . "." . $row3['origin']; + } + + print "$row2[name].$row3[origin]" . " $record_name\r\n"; mysql_select_db("dbispconfig"); $sql3 = mysql_query("SELECT substr(origin,1, LENGTH(origin)-1) AS origin FROM dns_soa where id=$row2[zone];"); $row3 = mysql_fetch_array($sql3); mysql_select_db("powerdns"); - mysql_query("INSERT INTO records (domain_id,name,content,ispconfig_id,type,ttl,prio,change_date) values ('$row2[zone]','$row2[name].$row3[origin]','$file2','$row2[id]','$row2[type]','$row2[ttl]','$row2[aux]','1260446221');"); + mysql_query("INSERT INTO records (domain_id,name,content,ispconfig_id,type,ttl,prio,change_date) values ('$row2[zone]','$record_name','$file2','$row2[id]','$row2[type]','$row2[ttl]','$row2[aux]','1260446221');"); } else { diff --git a/install/dist/lib/centos_base.lib.php b/install/dist/lib/centos_base.lib.php index 3b204165c8a4103ef72019dcd789a6d4a51a56af..8e6741fd693ec22c06fa1e1a38a54b1af1c5e4cf 100644 --- a/install/dist/lib/centos_base.lib.php +++ b/install/dist/lib/centos_base.lib.php @@ -48,14 +48,21 @@ class installer_centos extends installer_dist { $content = str_replace('{mysql_server_ip}', $conf['mysql']['ip'], $content); $content = str_replace('{hostname}', $conf['hostname'], $content); $content = str_replace('/var/spool/amavisd/clamd.sock', $this->clamav_socket, $content); - $content = str_replace('{amavis_config_dir}', $conf['amavis']['config_dir']); + $content = str_replace('{amavis_config_dir}', $conf['amavis']['config_dir'], $content); wf($conf["amavis"]["config_dir"].'/amavisd.conf', $content); chmod($conf['amavis']['config_dir'].'/amavisd.conf', 0640); + if(!is_file($conf['amavis']['config_dir'].'/60-dkim')) { + touch($conf['amavis']['config_dir'].'/60-dkim'); + chmod($conf['amavis']['config_dir'].'/60-dkim', 0640); + } + // for CentOS 7.2 only if($dist['confid'] == 'centos72') { chmod($conf['amavis']['config_dir'].'/amavisd.conf', 0750); chgrp($conf['amavis']['config_dir'].'/amavisd.conf', 'amavis'); + chmod($conf['amavis']['config_dir'].'/60-dkim', 0750); + chgrp($conf['amavis']['config_dir'].'/60-dkim', 'amavis'); } diff --git a/install/lib/install.lib.php b/install/lib/install.lib.php index 5d00c2a905424d908441d7c733b99fa0409133fb..a93208f86bfe8de80d03a6690fec256f00b72cef 100644 --- a/install/lib/install.lib.php +++ b/install/lib/install.lib.php @@ -180,6 +180,7 @@ function get_distname() { break; default: $relname = "UNKNOWN"; + $distconfid = 'ubuntu1604'; } $distver = $ver.$lts." ".$relname; swriteln("Operating System: ".$distname.' '.$distver."\n"); @@ -230,7 +231,8 @@ function get_distname() { } else { $distname = 'Debian'; $distver = 'Unknown'; - $distid = 'debian40'; + $distid = 'debian60'; + $distconfid = 'debian90'; $distbaseid = 'debian'; swriteln("Operating System: Debian or compatible, unknown version.\n"); } diff --git a/install/tpl/mysql-virtual_policy_greylist.cf.master b/install/tpl/mysql-virtual_policy_greylist.cf.master index 8beb7c4509c505f189313e401718a76deccaa473..fd6fded819745ebfcf47fd490ddd727b49be0315 100644 --- a/install/tpl/mysql-virtual_policy_greylist.cf.master +++ b/install/tpl/mysql-virtual_policy_greylist.cf.master @@ -1,5 +1,5 @@ user = {mysql_server_ispconfig_user} password = {mysql_server_ispconfig_password} dbname = {mysql_server_database} -query = SELECT 'greylisting' FROM (SELECT greylisting, source AS email FROM mail_forwarding WHERE server_id = {server_id} UNION SELECT greylisting, email FROM mail_user WHERE server_id = {server_id}) addresses WHERE addresses.email='%s' AND addresses.greylisting='y' +query = SELECT 'greylisting' FROM (SELECT greylisting, source AS email FROM mail_forwarding WHERE server_id = {server_id} UNION SELECT greylisting, email FROM mail_user WHERE server_id = {server_id}) addresses WHERE addresses.email='%s' AND addresses.greylisting='y' UNION SELECT 'greylisting' FROM `mail_forwarding` f CROSS JOIN `mail_user` u ON u.email = f.destination WHERE f.type = 'catchall' AND u.greylisting = 'y' AND u.server_id = {server_id} AND f.source = '@%s' hosts = {mysql_server_ip} \ No newline at end of file diff --git a/interface/lib/classes/remote.d/server.inc.php b/interface/lib/classes/remote.d/server.inc.php index 0e22b6c3494ff99af1bdd3295ecb7e464af80dc4..4962cb4c59e0a35575fcf4562c11322ae32fd07c 100644 --- a/interface/lib/classes/remote.d/server.inc.php +++ b/interface/lib/classes/remote.d/server.inc.php @@ -244,7 +244,7 @@ class remoting_server extends remoting { return false; } if (!empty($session_id)) { - if($server_id === 0) $ispc_app_version = array('ispc_app_version' => ISPC_APP_VERSION); + if($server_id == 0) $ispc_app_version = array('ispc_app_version' => ISPC_APP_VERSION); else { $rec = $app->db->queryOneRecord("SELECT data FROM monitor_data WHERE type = 'ispc_info' AND server_id = ?", $server_id); $rec = unserialize($rec['data']); diff --git a/interface/web/dns/templates/dns_dmarc_edit.htm b/interface/web/dns/templates/dns_dmarc_edit.htm index 8393d862d75b491cee45543b59ebff26d958de95..e7b113d11e5f361c67a0559adcbd6b93ac40c294 100644 --- a/interface/web/dns/templates/dns_dmarc_edit.htm +++ b/interface/web/dns/templates/dns_dmarc_edit.htm @@ -136,6 +136,13 @@ + +
+ +
+ +
+
diff --git a/interface/web/mail/xmpp_domain_edit.php b/interface/web/mail/xmpp_domain_edit.php index aaa8d640e8ae69e28aa426665e6aca7d563fa8e0..7109329f326bd2393cdc71440a5c17e812bec912 100644 --- a/interface/web/mail/xmpp_domain_edit.php +++ b/interface/web/mail/xmpp_domain_edit.php @@ -223,7 +223,7 @@ class page_action extends tform_actions { /* check if the domain module is used - and check if the selected domain can be used! */ $app->uses('ini_parser,getconf'); $settings = $app->getconf->get_global_config('domains'); - if ($settings['use_domain_module'] == 'y') { + if ((isset($this->dataRecord['domain'])) && ($settings['use_domain_module'] == 'y')) { if ($_SESSION["s"]["user"]["typ"] == 'admin' || $app->auth->has_clients($_SESSION['s']['user']['userid'])) { $this->dataRecord['client_group_id'] = $app->tools_sites->getClientIdForDomain($this->dataRecord['domain']); } diff --git a/server/conf/nginx_vhost.conf.master b/server/conf/nginx_vhost.conf.master index d5c6b7b79c64898c32bf7595852b0637d393f521..7b3c376e9818626c1b258ad8e4efdaf0489476e4 100644 --- a/server/conf/nginx_vhost.conf.master +++ b/server/conf/nginx_vhost.conf.master @@ -146,6 +146,8 @@ server { location = /favicon.ico { log_not_found off; access_log off; + expires max; + add_header Cache-Control "public, must-revalidate, proxy-revalidate"; } location = /robots.txt { diff --git a/server/conf/php-fcgi-starter.master b/server/conf/php-fcgi-starter.master index 7671a7007e1d67bb2e075f6f11e6786a66f5999d..d391c3186bd0e4b8b20f37c30ff63b389b8c42ca 100644 --- a/server/conf/php-fcgi-starter.master +++ b/server/conf/php-fcgi-starter.master @@ -14,8 +14,6 @@ export TMPDIR=/tmp export TEMP=/tmp exec \ -d open_basedir="" \ --d disable_functions="" \ --d suhosin.executor.func.blacklist="" \ -d upload_tmp_dir=/tmp \ -d session.save_path=/tmp \ -d sendmail_path="/usr/sbin/sendmail -t -i -f webmaster@" \ diff --git a/server/conf/vhost.conf.master b/server/conf/vhost.conf.master index 385f06f5fe923e98e39ad2e1ef0512d68e347de9..08476c498c8d4f0ab9d6e3697aa8d090eaf40e06 100644 --- a/server/conf/vhost.conf.master +++ b/server/conf/vhost.conf.master @@ -182,7 +182,7 @@ - + SetHandler mod_python @@ -362,10 +362,10 @@ Action php5-fcgi /php5-fcgi virtual Alias /php5-fcgi {tmpl_var name='document_root'}/cgi-bin/php5-fcgi-{tmpl_var name='ip_address'}-{tmpl_var name='port'}-{tmpl_var name='domain'} - FastCgiExternalServer {tmpl_var name='document_root'}/cgi-bin/php5-fcgi-{tmpl_var name='ip_address'}-{tmpl_var name='port'}-{tmpl_var name='domain'} -idle-timeout 300 -host 127.0.0.1: -pass-header Authorization + FastCgiExternalServer {tmpl_var name='document_root'}/cgi-bin/php5-fcgi-{tmpl_var name='ip_address'}-{tmpl_var name='port'}-{tmpl_var name='domain'} -idle-timeout 300 -host 127.0.0.1: -pass-header Authorization -pass-header Content-Type - FastCgiExternalServer {tmpl_var name='document_root'}/cgi-bin/php5-fcgi-{tmpl_var name='ip_address'}-{tmpl_var name='port'}-{tmpl_var name='domain'} -idle-timeout 300 -socket -pass-header Authorization + FastCgiExternalServer {tmpl_var name='document_root'}/cgi-bin/php5-fcgi-{tmpl_var name='ip_address'}-{tmpl_var name='port'}-{tmpl_var name='domain'} -idle-timeout 300 -socket -pass-header Authorization -pass-header Content-Type @@ -428,7 +428,7 @@ Action hhvm-fcgi /hhvm-fcgi virtual Alias /hhvm-fcgi {tmpl_var name='document_root'}/cgi-bin/hhvm-fcgi-{tmpl_var name='ip_address'}-{tmpl_var name='port'}-{tmpl_var name='domain'} - FastCgiExternalServer {tmpl_var name='document_root'}/cgi-bin/hhvm-fcgi-{tmpl_var name='ip_address'}-{tmpl_var name='port'}-{tmpl_var name='domain'} -idle-timeout 300 -socket /var/run/hhvm/hhvm..sock -pass-header Authorization + FastCgiExternalServer {tmpl_var name='document_root'}/cgi-bin/hhvm-fcgi-{tmpl_var name='ip_address'}-{tmpl_var name='port'}-{tmpl_var name='domain'} -idle-timeout 300 -socket /var/run/hhvm/hhvm..sock -pass-header Authorization -pass-header Content-Type diff --git a/server/plugins-available/apache2_plugin.inc.php b/server/plugins-available/apache2_plugin.inc.php index d6c9a56ff60080cfaee1309dad6caef53e9b4a43..af31327efd13e0897c4410feb0ffe466e91c379f 100644 --- a/server/plugins-available/apache2_plugin.inc.php +++ b/server/plugins-available/apache2_plugin.inc.php @@ -705,6 +705,13 @@ class apache2_plugin { if(!is_dir($data['new']['document_root'].'/cgi-bin')) $app->system->mkdirpath($data['new']['document_root'].'/cgi-bin'); if(!is_dir($data['new']['document_root'].'/tmp')) $app->system->mkdirpath($data['new']['document_root'].'/tmp'); if(!is_dir($data['new']['document_root'].'/webdav')) $app->system->mkdirpath($data['new']['document_root'].'/webdav'); + + if(!is_dir($data['new']['document_root'].'/.ssh')) { + $app->system->mkdirpath($data['new']['document_root'].'/.ssh'); + $app->system->chmod($data['new']['document_root'].'/.ssh', 0700); + $app->system->chown($data['new']['document_root'].'/.ssh', $username); + $app->system->chgrp($data['new']['document_root'].'/.ssh', $groupname); + } //* Create the new private directory if(!is_dir($data['new']['document_root'].'/private')) { @@ -2741,10 +2748,14 @@ class apache2_plugin { $output .= "\n"; $output .= "Alias /webdav/$fn $webdavRoot/$fn\n"; $output .= "\n"; - $output .= "Dav On\n"; + $output .= "DAV On\n"; $output .= "BrowserMatch MSIE AuthDigestEnableQueryStringHack=On\n"; $output .= "AuthType Digest\n"; - $output .= 'AuthName "'.(empty($fn)?'/':$fn)."\"\n"; + if($fn != '' && $fn != '/') { + $output .= " AuthName \"" . $fn . "\"\n"; + } else { + $output .= " AuthName \"Restricted Area\"\n"; + } $output .= "AuthUserFile $webdavRoot/$file\n"; $output .= "Require valid-user\n"; $output .= "Options +Indexes\n"; diff --git a/server/plugins-available/mysql_clientdb_plugin.inc.php b/server/plugins-available/mysql_clientdb_plugin.inc.php index 58215389db4f29d99e5b7b9d48e48d945840b3a7..35ade14c45a9c095a6c1629ed3ebfcaa1a09e3df 100644 --- a/server/plugins-available/mysql_clientdb_plugin.inc.php +++ b/server/plugins-available/mysql_clientdb_plugin.inc.php @@ -78,13 +78,16 @@ class mysql_clientdb_plugin { $unwanted_sql_plugins = array('validate_password'); // strict-password-validation $temp = "'".implode("','", $unwanted_sql_plugins)."'"; $result = $link->query("SELECT plugin_name FROM information_schema.plugins WHERE plugin_status='ACTIVE' AND plugin_name IN ($temp)"); - if($result) { + if($result && $result->num_rows > 0) { + $sql_plugins = array(); while ($row = $result->fetch_assoc()) { $sql_plugins[] = $row['plugin_name']; } $result->free(); - foreach ($sql_plugins as $plugin) $app->log("MySQL-Plugin $plugin enabled - can not execute function process_host_list", LOGLEVEL_ERROR); - return false; + if(count($sql_plugins) > 0) { + foreach ($sql_plugins as $plugin) $app->log("MySQL-Plugin $plugin enabled - can not execute function process_host_list", LOGLEVEL_ERROR); + return false; + } } if(!$user_access_mode) $user_access_mode = 'rw'; diff --git a/server/plugins-available/nginx_plugin.inc.php b/server/plugins-available/nginx_plugin.inc.php index b41aea384f8e6229f3a612f41e9c9a33a0b064e4..83ac769ddeb71b6d74849383d81f458b5376f5ae 100644 --- a/server/plugins-available/nginx_plugin.inc.php +++ b/server/plugins-available/nginx_plugin.inc.php @@ -552,7 +552,14 @@ class nginx_plugin { if(!is_dir($data['new']['document_root'].'/cgi-bin')) $app->system->mkdirpath($data['new']['document_root'].'/cgi-bin'); if(!is_dir($data['new']['document_root'].'/tmp')) $app->system->mkdirpath($data['new']['document_root'].'/tmp'); //if(!is_dir($data['new']['document_root'].'/webdav')) $app->system->mkdirpath($data['new']['document_root'].'/webdav'); - + + if(!is_dir($data['new']['document_root'].'/.ssh')) { + $app->system->mkdirpath($data['new']['document_root'].'/.ssh'); + $app->system->chmod($data['new']['document_root'].'/.ssh', 0700); + $app->system->chown($data['new']['document_root'].'/.ssh', $username); + $app->system->chgrp($data['new']['document_root'].'/.ssh', $groupname); + } + //* Create the new private directory if(!is_dir($data['new']['document_root'].'/private')) { $app->system->mkdirpath($data['new']['document_root'].'/private');