diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php
index bbf8cfd3b794fda0f2677b16c252716a41870d34..481c3e7ff36a0280dab725a6401b5792b9329228 100644
--- a/install/lib/installer_base.lib.php
+++ b/install/lib/installer_base.lib.php
@@ -172,9 +172,9 @@ class installer_base {
 		if(is_installed('squid')) $conf['squid']['installed'] = true;
 		if(is_installed('nginx')) $conf['nginx']['installed'] = true;
 		if(is_installed('iptables') && is_installed('ufw')) $conf['ufw']['installed'] = true;
+		if(is_installed('iptables') && is_installed('bastille-netfilter')) $conf['firewall']['installed'] = true;
 		if(is_installed('fail2ban-server')) $conf['fail2ban']['installed'] = true;
 		if(is_installed('vzctl')) $conf['openvz']['installed'] = true;
-		if(is_installed('iptables') && is_installed('bastille-netfilter')) $conf['bastille']['installed'] = true;
 		if(is_installed('metronome') && is_installed('metronomectl')) $conf['xmpp']['installed'] = true;
 		if(is_installed('spamassassin')) $conf['spamassassin']['installed'] = true;
 		if(is_installed('vlogger')) $conf['vlogger']['installed'] = true;
diff --git a/install/tpl/nginx_apps.vhost.master b/install/tpl/nginx_apps.vhost.master
index 6fad927b688786127c3e59e9174d3730a8ff0c4b..d2dc07ba10de47fe263b51f38998f2964f8f7af7 100644
--- a/install/tpl/nginx_apps.vhost.master
+++ b/install/tpl/nginx_apps.vhost.master
@@ -1,6 +1,6 @@
 server {
-        listen {apps_vhost_ip};
-        listen [::]:{apps_vhost_port};
+        listen {apps_vhost_port};
+        listen [::]:{apps_vhost_port} ipv6only=on;
         ssl {ssl_on};
         {ssl_comment}ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
         {ssl_comment}ssl_certificate /usr/local/ispconfig/interface/ssl/ispserver.crt;
diff --git a/install/tpl/nginx_ispconfig.vhost.master b/install/tpl/nginx_ispconfig.vhost.master
index 6102cef9eb5dc6e61104ef9f85a4d8d3333eeb0e..849877020dfde0c7ff2bf15f1cdea5366d077f9e 100644
--- a/install/tpl/nginx_ispconfig.vhost.master
+++ b/install/tpl/nginx_ispconfig.vhost.master
@@ -1,6 +1,6 @@
 server {
         listen {vhost_port};
-        listen [::]:{vhost_port}
+        listen [::]:{vhost_port} ipv6only=on;
 		ssl {ssl_on};
 		{ssl_comment}ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
         {ssl_comment}ssl_certificate /usr/local/ispconfig/interface/ssl/ispserver.crt;
@@ -81,4 +81,4 @@ server {
 #        location /webmail {
 #               rewrite ^/* /squirrelmail last;
 #        }
-}
\ No newline at end of file
+}
diff --git a/interface/web/admin/form/server_config.tform.php b/interface/web/admin/form/server_config.tform.php
index 7e37550eb44987af3e2c7942f6deabd47b15433b..9343084d041a3a35a974f861da62e4a53e1b2d25 100644
--- a/interface/web/admin/form/server_config.tform.php
+++ b/interface/web/admin/form/server_config.tform.php
@@ -170,7 +170,7 @@ $form["tabs"]['server'] = array(
 			'formtype' => 'TEXT',
 			'default' => '/var/backup',
 			'validators' => array(	0 => array ( 	'type' => 'REGEX',
-										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/]{5,128}$/',
+										'regex' => "/(|^\\/{1,2}(?:[\\w-]+[.]?\\/?){5,128})$/",
 										'errmsg'=> 'backup_dir_error_regex'),
 			),
 			'value' => '',
diff --git a/interface/web/dns/dns_import.php b/interface/web/dns/dns_import.php
index 7e96a42d8c40d983db4ff77fad71cd1513d69d3b..2e4d58e192575ae4f55421256c0fd46eecef68d1 100644
--- a/interface/web/dns/dns_import.php
+++ b/interface/web/dns/dns_import.php
@@ -215,9 +215,22 @@ if(isset($_FILES['file']['name']) && is_uploaded_file($_FILES['file']['tmp_name'
 	foreach($lines as $line){
 		$line = trim($line);
 		if ($line != '' && substr($line, 0, 1) != ';'){
-			if(strpos($line, ";") !== FALSE) $line = substr($line, 0, strpos($line, ";"));
-			if(strpos($line, "(") !== FALSE) $line = substr($line, 0, strpos($line, "("));
-			if(strpos($line, ")") !== FALSE) $line = substr($line, 0, strpos($line, ")"));
+			if(strpos($line, ";") !== FALSE) {
+				if (!preg_match("/v=DKIM|v=DMARC/",$line)) {
+					$line = substr($line, 0, strpos($line, ";"));
+				}
+			}
+			if(strpos($line, "(") !== FALSE ) {
+				if (!preg_match("/v=DKIM/",$line)) {
+					$line = substr($line, 0, strpos($line, "("));
+				}
+			}
+			if(strpos($line, ")") !== FALSE ) {
+				if (!preg_match("/v=DKIM/",$line)) {
+					$line = substr($line, 0, strpos($line, ")"));
+				}
+			}
+			
 			$line = trim($line);
 			if ($line != ''){
 				$sPattern = '/\s+/m';
@@ -253,10 +266,17 @@ if(isset($_FILES['file']['name']) && is_uploaded_file($_FILES['file']['tmp_name'
 
 		$parts = explode(' ', $line);
 
-		// make all elements lowercase
+		// make elements lowercase
+		$dkim=@($parts[3]=='"v=DKIM1;')?true:false;
+		$dmarc=@($parts[3]=='"v=DMARC1;')?true:false;
+
 		$new_parts = array();
 		foreach($parts as $part){
-			$new_parts[] = strtolower($part);
+			if(!$dkim && !$dmarc) {
+				$new_parts[] = strtolower($part);
+			} else {
+				$new_parts[] = $part;
+			}
 		}
 		unset($parts);
 		$parts = $new_parts;
@@ -557,130 +577,6 @@ if(isset($_FILES['file']['name']) && is_uploaded_file($_FILES['file']['tmp_name'
 		$i++;
 	}
 
-	/*
-	$i = 0;
-	$r = 0;
-	$s = 0;
-	$dns_rr = array();
-	foreach ($lines as $line)
-	{
-		$line = trim($line);
-		if ($line != '' && substr($line,0,1) != ';' && substr($line,0,1) != '$')
-		{
-			$line = str_replace("\n",NULL,$line);
-			$i++;
-
-			// TODO - Find a better way to parse the SOA record. Lazy checking.
-			if ($i <= 7)
-			{
-				if ($i > 1)
-				{
-					$s++;
-					$line = str_replace("\t",NULL,$line);
-					if (!empty($line))
-					{
-						print(strpos(";",$line));
-						$line = substr($line,0,strpos($line,";"));
-						if ($s == 1)
-							$soa['serial'] = $line;
-						else if ($s == 2)
-							$soa['refresh'] = $line;
-						else if ($s == 3)
-							$soa['retry'] = $line;
-						else if ($s == 4)
-							$soa['expire'] = $line;
-						else if ($s == 5)
-							$soa['minimum'] = $line;
-
-					}
-				}
-				else
-				{
-					$line = str_replace("\t",",",$line);
-					$line = str_replace(" ",",",$line);
-					$recs = explode(",",$line);
-
-					foreach ($recs as $key => $rec)
-					{
-						$rec = trim($rec);
-						if($rec == '') continue;
-						//name	type	data	aux	ttl	active
-						if ($key == 0)
-						{
-							if ($rec == '@')
-							{
-								$rec = $name;
-							}
-
-							$soa['name'] = $rec;
-						}
-
-						if ($key != 0 && strtolower($rec) == 'soa')
-						{
-							$typekeys[$s] = $key;
-						}
-						else if ($key > $typekey[$r])
-						{
-							if ($rec != "" && $rec != "(")
-							{
-								$rec = explode(" ",$rec);
-
-								$soa['ns'] = $servers[0]['server_name'];
-								$soa['mbox'] = $rec[1];
-							}
-						}
-					}
-				}
-			}
-			else
-			{
-				$line = str_replace("\n","",trim($line));
-
-				if (!empty($line))
-				{
-
-					preg_match_all('/(.*?)\s*IN\s*(A|CNAME|MX|TXT|NS|AAAA)\s*(.*)/',$line, $recs);
-
-					if ($recs[1][0] == '@' || trim($recs[1][0]) == "")
-					{
-						$recs[1][0] = $name;
-					}
-					$dns_rr[$r]['name'] = $recs[1][0];
-					$dns_rr[$r]['type'] = $recs[2][0];
-					if (strtolower($dns_rr[$r]['type'])=='mx')
-					{
-						$recs[3][0] = str_replace(" ","\t",$recs[3][0]);
-						$mx[$r] = explode("\t",$recs[3][0]);
-						for ($m=1;$m<count($mx[$r]);$m++)
-						{
-							if (!empty($mx[$r][$m]))
-								$dns_rr[$r]['data'] = $mx[$r][$m];
-						}
-
-						$dns_rr[$r]['aux'] = $mx[$r][0];
-					}
-					else if (strtolower($dns_rr[$r]['type'])=='txt')
-					{
-						$dns_rr[$r]['data'] = substr($recs[3][0],1,(strlen($recs[3][0])-2));
-					}
-					else
-					{
-						$dns_rr[$r]['data'] = $recs[3][0];
-					}
-
-					if (strtolower($dns_rr[$r]['type'])=='ns' && strtolower($dns_rr[$r]['name'])==$name)
-					{
-						unset($dns_rr[$r]);
-					}
-
-					$r++;
-				}
-			}
-
-		}
-	}
-	*/
-
 	foreach ($servers as $server){
 		$dns_rr[$r]['name'] = $soa['name'];
 		$dns_rr[$r]['type'] = 'NS';
diff --git a/server/conf/nginx_apps.vhost.master b/server/conf/nginx_apps.vhost.master
index a8e8ee514acd43b64cc80be06eb6ead859f76661..1101d193058a1f5f438f257668da6b38d4d84cc7 100644
--- a/server/conf/nginx_apps.vhost.master
+++ b/server/conf/nginx_apps.vhost.master
@@ -106,7 +106,7 @@ server {
         location /phpMyAdmin {
                rewrite ^/* /phpmyadmin last;
         }
-		
+
         location /squirrelmail {
                root /usr/share/;
                index index.php index.html index.htm;
@@ -164,7 +164,6 @@ server {
                fastcgi_param   CONTENT_TYPE            $content_type;
                fastcgi_param   CONTENT_LENGTH          $content_length;
 
-               fastcgi_param   SCRIPT_FILENAME         $request_filename;
                fastcgi_param   SCRIPT_NAME             $fastcgi_script_name;
                fastcgi_param   REQUEST_URI             $request_uri;
                fastcgi_param   DOCUMENT_URI            $document_uri;
@@ -199,4 +198,4 @@ server {
                alias /var/lib/mailman/archives/public;
                autoindex on;
         }
-}
\ No newline at end of file
+}
diff --git a/server/conf/php_fpm_pool.conf.master b/server/conf/php_fpm_pool.conf.master
index b60eb987012cf29aa1a88ea36bda22b592c1fb11..2ef6417c64d16d42a1a6ca05220e3867cfa9f9b2 100644
--- a/server/conf/php_fpm_pool.conf.master
+++ b/server/conf/php_fpm_pool.conf.master
@@ -34,7 +34,9 @@ env[TEMP] = <tmpl_var name='document_root'>/tmp
 
 <tmpl_if name='security_level' op='==' value='20'>
 <tmpl_var name='enable_php_open_basedir'>php_admin_value[open_basedir] = <tmpl_var name='php_open_basedir'>
-<tmpl_if name='custom_session_save_path' op='!=' value='y'>php_admin_value[session.save_path] = <tmpl_var name='document_root'>/tmp</tmpl_if>
+<tmpl_if name='custom_session_save_path' op='!=' value='y'>
+php_admin_value[session.save_path] = <tmpl_var name='document_root'>/tmp
+</tmpl_if>
 php_admin_value[upload_tmp_dir] = <tmpl_var name='document_root'>/tmp
 php_admin_value[sendmail_path] = "/usr/sbin/sendmail -t -i -f webmaster@<tmpl_var name='domain'>"
 </tmpl_if>
diff --git a/server/scripts/update_from_dev.sh b/server/scripts/update_from_dev.sh
index fe2f6ef956d2554f64484ce1d9ad95587b4ce743..0be65986d68b56fcf97e536447be8676f2ab7c24 100755
--- a/server/scripts/update_from_dev.sh
+++ b/server/scripts/update_from_dev.sh
@@ -10,7 +10,7 @@
     exit 1
 }
 
-wget -O ispconfig3-dev.tar.gz "http://git.ispconfig.org/ispconfig/ispconfig3/repository/archive.tar.gz?ref=master"
+wget -O ispconfig3-dev.tar.gz "https://git.ispconfig.org/ispconfig/ispconfig3/repository/archive.tar.gz?ref=master"
 tar xzf ispconfig3-dev.tar.gz
 
 echo -n "Latest git version:  "
diff --git a/server/scripts/update_from_dev_stable.sh b/server/scripts/update_from_dev_stable.sh
index de2e6a47b5fabc0f3389420e650433f2fc7872ce..a5dc10605b1ce72f36cb5116067d077702d0f62f 100644
--- a/server/scripts/update_from_dev_stable.sh
+++ b/server/scripts/update_from_dev_stable.sh
@@ -10,7 +10,7 @@
     exit 1
 }
 
-wget -O ispconfig3-dev.tar.gz "http://git.ispconfig.org/ispconfig/ispconfig3/repository/archive.tar.gz?ref=stable-3.1"
+wget -O ispconfig3-dev.tar.gz "https://git.ispconfig.org/ispconfig/ispconfig3/repository/archive.tar.gz?ref=stable-3.1"
 tar xzf ispconfig3-dev.tar.gz
 
 echo -n "Latest git version:  "