diff --git a/install/install.php b/install/install.php
index 9dff3facf2e71a085e1cbc0994eb7cc8e967957b..fc6f9e10c0766c8ac049050c9fbea6ef4b7e3205 100644
--- a/install/install.php
+++ b/install/install.php
@@ -150,6 +150,8 @@ if (!$inst->get_php_version()) die('ISPConfig requieres PHP '.$inst->min_php."\n
 $retval=shell_exec("which which");
 if (empty($retval)) die ("ISPConfig requieres which \n");
 
+$inst->check_prerequisites();
+
 swriteln($inst->lng('    Following will be a few questions for primary configuration so be careful.'));
 swriteln($inst->lng('    Default values are in [brackets] and can be accepted with <ENTER>.'));
 swriteln($inst->lng('    Tap in "quit" (without the quotes) to stop the installer.'."\n\n"));
@@ -574,6 +576,12 @@ if($install_mode == 'standard' || strtolower($inst->simple_query('Install ISPCon
 	$inst->install_ispconfig_interface = false;
 }
 
+// Create SSL certs for non-webserver(s)?
+if(!file_exists('/usr/local/ispconfig/interface/ssl/ispserver.crt')) {
+    if(strtolower($inst->simple_query('Do you want to create SSL certs for your server?', array('y', 'n'), 'y')) == 'y')
+        $inst->make_ispconfig_ssl_cert();
+}
+
 $inst->install_ispconfig();
 
 //* Configure DBServer
diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php
index 11163806abfc75774d41b0880a53c67b6ac6fdc4..4d462e6d485e51a94ce24fddc98f6f2253242d13 100644
--- a/install/lib/installer_base.lib.php
+++ b/install/lib/installer_base.lib.php
@@ -1,7 +1,7 @@
 <?php
 
 /*
-Copyright (c) 2007-2010, Till Brehm, projektfarm Gmbh
+Copyright (c) 2007-2019, Till Brehm, projektfarm GmbH
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without modification,
@@ -198,6 +198,18 @@ class installer_base {
 
 		if (($conf['apache']['installed'] && is_file($conf['apache']["vhost_conf_enabled_dir"]."/000-ispconfig.vhost")) || ($conf['nginx']['installed'] && is_file($conf['nginx']["vhost_conf_enabled_dir"]."/000-ispconfig.vhost"))) $this->ispconfig_interface_installed = true;
 	}
+	
+	//** Check prerequisites
+	public function check_prerequisites() {
+		$msg = '';
+		
+		if(version_compare(phpversion(), '5.4', '<')) $msg .= "PHP Version 5.4 or newer is required. The currently used PHP version is ".phpversion().".\n";
+		if(!function_exists('curl_init')) $msg .= "PHP Curl Module is missing.\n";
+		if(!function_exists('mysqli_connect')) $msg .= "PHP MySQLi Module is nmissing.\n";
+		if(!function_exists('mb_detect_encoding')) $msg .= "PHP Multibyte Module (MB) is missing.\n";
+		
+		if($msg != '') die($msg);
+	}
 
     public function force_configure_app($service, $enable_force=true) {
 		$force = false;
@@ -235,21 +247,27 @@ class installer_base {
 	public function configure_database() {
 		global $conf;
 
-		//* check sql-mode
-		/*$check_sql_mode = $this->db->queryOneRecord("SELECT @@sql_mode");
-
-		if ($check_sql_mode['@@sql_mode'] != '' && $check_sql_mode['@@sql_mode'] != 'NO_ENGINE_SUBSTITUTION') {
-			echo "Wrong SQL-mode. You should use NO_ENGINE_SUBSTITUTION. Add\n\n";
-			echo "    sql-mode=\"NO_ENGINE_SUBSTITUTION\"\n\n";
-			echo"to the mysqld-section in your mysql-config on this server and restart mysqld afterwards\n";
-			die();
-		}*/
-
-		$unwanted_sql_plugins = array('validate_password');
-		$sql_plugins = $this->db->queryAllRecords("SELECT plugin_name FROM information_schema.plugins WHERE plugin_status='ACTIVE' AND plugin_name IN ?", $unwanted_sql_plugins);
-		if(is_array($sql_plugins) && !empty($sql_plugins)) {
-			foreach ($sql_plugins as $plugin) echo "Login in to MySQL and disable $plugin[plugin_name] with:\n\n    UNINSTALL PLUGIN $plugin[plugin_name];";
-			die();
+		//** Check for unwanted plugins
+		if ($this->db->getDatabaseType() == 'mysql' && $this->db->getDatabaseVersion(true) >= 8) {
+			// component approach since MySQL 8.0
+			$unwanted_components = [
+				'file://component_validate_password',
+			];
+			$sql_components = $this->db->queryAllRecords("SELECT * FROM mysql.component where component_urn IN ?", $unwanted_components);
+			if(is_array($sql_components) && !empty($sql_components)) {
+				foreach ($sql_components as $component) {
+					$component_name = parse_url($component['component_urn'], PHP_URL_HOST);
+					echo "Login in to MySQL and disable '{$component_name}' with:\n\n    UNINSTALL COMPONENT '{$component['component_urn']}';\n\n";
+				}
+				die();
+			}
+		} else {
+			$unwanted_sql_plugins = array('validate_password');
+			$sql_plugins = $this->db->queryAllRecords("SELECT plugin_name FROM information_schema.plugins WHERE plugin_status='ACTIVE' AND plugin_name IN ?", $unwanted_sql_plugins);
+			if(is_array($sql_plugins) && !empty($sql_plugins)) {
+				foreach ($sql_plugins as $plugin) echo "Login in to MySQL and disable $plugin[plugin_name] with:\n\n    UNINSTALL PLUGIN $plugin[plugin_name];";
+				die();
+			}
 		}
 
 		//** Create the database
@@ -308,6 +326,15 @@ class installer_base {
 		if(!$this->db->query($query, $conf['mysql']['database'] . ".*", $conf['mysql']['ispconfig_user'], $from_host)) {
 			$this->error('Unable to grant databse permissions to user: '.$conf['mysql']['ispconfig_user'].' Error: '.$this->db->errorMessage);
 		}
+		
+		// add correct administrative rights to IPSConfig user (SUPER is deprecated and unnecessarily powerful)
+		 if ($this->db->getDatabaseType() == 'mysql' && $this->db->getDatabaseVersion(true) >= 8) {
+			// there might be more needed on replicated db environments, this was not tested
+			$query = 'GRANT SYSTEM_VARIABLES_ADMIN ON *.* TO ?@?';
+			if(!$this->db->query($query, $conf['mysql']['ispconfig_user'], $from_host)) {
+				$this->error('Unable to grant administrative permissions to user: '.$conf['mysql']['ispconfig_user'].' Error: '.$this->db->errorMessage);
+			}
+		}
 
 		//* Set the database name in the DB library
 		$this->db->setDBName($conf['mysql']['database']);
@@ -2657,34 +2684,254 @@ class installer_base {
 			if(!@is_link($vhost_conf_enabled_dir.'/000-apps.vhost')) {
 				symlink($vhost_conf_dir.'/apps.vhost', $vhost_conf_enabled_dir.'/000-apps.vhost');
 			}
+		}
+	}
 
+	private function curl_request($url, $use_ipv6 = false) {
+		$set_headers = [
+			'Connection: Close',
+			'User-Agent: ISPConfig/3',
+			'Accept: */*'
+		];
+
+		$ch = curl_init($url);
+        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
+        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
+        curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);
+        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
+        curl_setopt($ch, CURLOPT_HTTPHEADER, $set_headers);
+		curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
+		curl_setopt($ch, CURLOPT_MAXREDIRS, 5);
+
+		if($use_ipv6) {
+			if(defined('CURLOPT_IPRESOLVE') && defined('CURL_IPRESOLVE_V6')) {
+				curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V6);
+			}
+		} else {
+			if(defined('CURLOPT_IPRESOLVE') && defined('CURL_IPRESOLVE_V4')) {
+				curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
+			}
 		}
+
+		$response = curl_exec($ch);
+		curl_close($ch);
+
+		return $response;
 	}
 
 	public function make_ispconfig_ssl_cert() {
-		global $conf,$autoinstall;
+		global $conf, $autoinstall;
 
-		$install_dir = $conf['ispconfig_install_dir'];
+		//* Get hostname from user entry or shell command */
+		if($conf['hostname'] !== 'localhost' && $conf['hostname'] !== '') {
+			$hostname = $conf['hostname'];
+		} else {
+			$hostname = exec('hostname -f');
+		}
+
+		// Check dns a record exist and its ip equal to server public ip
+		$svr_ip4 = $this->curl_request('https://ispconfig.org/remoteip.php', false);
+		$svr_ip6 = $this->curl_request('https://ispconfig.org/remoteip.php', true);
+
+		if(function_exists('idn_to_ascii')) {
+			if(defined('IDNA_NONTRANSITIONAL_TO_ASCII') && defined('INTL_IDNA_VARIANT_UTS46') && constant('IDNA_NONTRANSITIONAL_TO_ASCII')) {
+				$hostname = idn_to_ascii($hostname, IDNA_NONTRANSITIONAL_TO_ASCII, INTL_IDNA_VARIANT_UTS46);
+			} else {
+				$hostname = idn_to_ascii($hostname);
+			}
+		}
+		$dns_ips = array();
+		if (checkdnsrr($hostname, 'A')) {
+			$dnsa=dns_get_record($hostname, DNS_A);
+			if($dnsa) {
+				foreach ($dnsa as $rec) {
+					$dns_ips[] = $rec['ip'];
+				}
+			}
+		}
+		if (checkdnsrr($hostname, 'AAAA')) {
+			$dnsaaaa=dns_get_record($hostname, DNS_AAAA);
+			if($dnsaaaa) {
+				foreach ($dnsaaaa as $rec) {
+					$dns_ips[] = $rec['ip'];
+				}
+			}
+		}
+
+		// Request for certs if no LE SSL folder for server fqdn exist
+		$le_live_dir = '/etc/letsencrypt/live/' . $hostname;
+		if (!@is_dir($le_live_dir) && (
+				($svr_ip4 && in_array($svr_ip4, $dns_ips)) || ($svr_ip6 && in_array($svr_ip6, $dns_ips))
+			)) {
+
+			// This script is needed earlier to check and open http port 80 or standalone might fail
+			// Make executable and temporary symlink latest letsencrypt pre, post and renew hook script before install
+			if(file_exists(dirname(getcwd()) . '/server/scripts/letsencrypt_pre_hook.sh')) {
+				symlink(dirname(getcwd()) . '/server/scripts/letsencrypt_pre_hook.sh', '/usr/local/bin/letsencrypt_pre_hook.sh');
+			}
+			if(file_exists(dirname(getcwd()) . '/server/scripts/letsencrypt_post_hook.sh')) {
+				symlink(dirname(getcwd()) . '/server/scripts/letsencrypt_post_hook.sh', '/usr/local/bin/letsencrypt_post_hook.sh');
+			}
+			if(file_exists(dirname(getcwd()) . '/server/scripts/letsencrypt_renew_hook.sh')) {
+				symlink(dirname(getcwd()) . '/server/scripts/letsencrypt_renew_hook.sh', '/usr/local/bin/letsencrypt_renew_hook.sh');
+			}
+			chown('/usr/local/bin/letsencrypt_pre_hook.sh', 'root');
+			chown('/usr/local/bin/letsencrypt_post_hook.sh', 'root');
+			chown('/usr/local/bin/letsencrypt_renew_hook.sh', 'root');
+			chmod('/usr/local/bin/letsencrypt_pre_hook.sh', 0700);
+			chmod('/usr/local/bin/letsencrypt_post_hook.sh', 0700);
+			chmod('/usr/local/bin/letsencrypt_renew_hook.sh', 0700);
+
+			// Check http port 80 status as it cannot be determined at post hook stage
+			$port80_status=exec('true &>/dev/null </dev/tcp/127.0.0.1/80 && echo open || echo close');
+
+			// Set pre-, post- and renew hook
+			$pre_hook = "--pre-hook \"letsencrypt_pre_hook.sh\"";
+			$renew_hook = "  --renew-hook \"letsencrypt_renew_hook.sh\"";
+			if($port80_status == 'close') {
+				$post_hook = " --post-hook \"letsencrypt_post_hook.sh\"";
+				$hook = $pre_hook . $post_hook . $renew_hook;
+			} else {
+				$hook = $pre_hook . $renew_hook;
+			}
+
+			// Get the default LE client name and version
+			$le_client = explode("\n", shell_exec('which letsencrypt certbot /root/.local/share/letsencrypt/bin/letsencrypt /opt/eff.org/certbot/venv/bin/certbot'));
+			$le_client = reset($le_client);
+
+			// Check for Neilpang acme.sh as well
+			$acme = explode("\n", shell_exec('which /usr/local/ispconfig/server/scripts/acme.sh /root/.acme.sh/acme.sh'));
+			$acme = reset($acme);
+
+			// Attempt to use Neilpang acme.sh first, as it is now the preferred LE client
+			if (is_executable($acme)) {
+
+				if($conf['nginx']['installed'] == true) {
+					exec("$acme --issue --nginx -d $hostname $renew_hook");
+				} elseif($conf['apache']['installed'] == true) {
+					exec("$acme --issue --apache -d $hostname $renew_hook");
+				}
+				// Else, it is not webserver, so we use standalone
+				else {
+					exec("$acme --issue --standalone -d $hostname $hook");
+				}
+
+				// Define LE certs name and path, then install them
+				if (!@is_dir($le_live_dir)) mkdir($le_live_dir, 0755, true);
+				$acme_cert = "--cert-file $le_live_dir/cert.pem";
+				$acme_key = "--key-file $le_live_dir/privkey.pem";
+				$acme_ca = "--ca-file $le_live_dir/chain.pem";
+				$acme_chain = "--fullchain-file $le_live_dir/fullchain.pem";
+				exec("$acme --install-cert -d $hostname $acme_cert $acme_key $acme_ca $acme_chain");
+
+			// Else, we attempt to use the official LE certbot client certbot
+			} else {
+
+				//  But only if it is otherwise available
+				if(is_executable($le_client)) {
+
+					// Get its version info due to be used for webroot arguement issues
+					$le_info = exec($le_client . ' --version  2>&1', $ret, $val);
+					if(preg_match('/^(\S+|\w+)\s+(\d+(\.\d+)+)$/', $le_info, $matches)) {
+						$le_version = $matches[2];
+					}
+
+					// Define certbot commands
+					$acme_version = '--server https://acme-v0' . (($le_version >=0.22) ? '2' : '1') . '.api.letsencrypt.org/directory';
+					$certonly = 'certonly --agree-tos --non-interactive --expand --rsa-key-size 4096';
+
+					// If this is a webserver
+					if($conf['nginx']['installed'] == true)
+						exec("$le_client $certonly $acme_version --nginx --email postmaster@$hostname $renew_hook");
+					elseif($conf['apache']['installed'] == true)
+						exec("$le_client $certonly $acme_version --apache --email postmaster@$hostname $renew_hook");
+					// Else, it is not webserver, so we use standalone
+					else
+						exec("$le_client $certonly $acme_version --standalone --email postmaster@$hostname -d $hostname $hook");
+				}
+			}
+		}
+
+		//* Define and check ISPConfig SSL folder */
+		$ssl_dir = $conf['ispconfig_install_dir'].'/interface/ssl';
+		if(!@is_dir($ssl_dir)) mkdir($ssl_dir, 0755, true);
 
-		$ssl_crt_file = $install_dir.'/interface/ssl/ispserver.crt';
-		$ssl_csr_file = $install_dir.'/interface/ssl/ispserver.csr';
-		$ssl_key_file = $install_dir.'/interface/ssl/ispserver.key';
+		$ssl_crt_file = $ssl_dir.'/ispserver.crt';
+		$ssl_csr_file = $ssl_dir.'/ispserver.csr';
+		$ssl_key_file = $ssl_dir.'/ispserver.key';
+		$ssl_pem_file = $ssl_dir.'/ispserver.pem';
 
-		if(!@is_dir($install_dir.'/interface/ssl')) mkdir($install_dir.'/interface/ssl', 0755, true);
+		$date = new DateTime();
+
+		// If the LE SSL certs for this hostname exists
+		if (is_dir($le_live_dir) && in_array($svr_ip, $dns_ips)) {
+
+			// Backup existing ispserver ssl files
+			if (file_exists($ssl_crt_file)) rename($ssl_crt_file, $ssl_crt_file . '-' .$date->format('YmdHis') . '.bak');
+			if (file_exists($ssl_key_file)) rename($ssl_key_file, $ssl_key_file . '-' .$date->format('YmdHis') . '.bak');
+			if (file_exists($ssl_pem_file)) rename($ssl_pem_file, $ssl_pem_file . '-' .$date->format('YmdHis') . '.bak');
+
+			// Create symlink to LE fullchain and key for ISPConfig
+			symlink($le_live_dir.'/fullchain.pem', $ssl_crt_file);
+			symlink($le_live_dir.'/privkey.pem', $ssl_key_file);
 
-		$ssl_pw = substr(md5(mt_rand()), 0, 6);
-		exec("openssl genrsa -des3 -passout pass:$ssl_pw -out $ssl_key_file 4096");
-		if(AUTOINSTALL){
-			exec("openssl req -new -passin pass:$ssl_pw -passout pass:$ssl_pw -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'])."' -key $ssl_key_file -out $ssl_csr_file");
 		} else {
-			exec("openssl req -new -passin pass:$ssl_pw -passout pass:$ssl_pw -key $ssl_key_file -out $ssl_csr_file");
+
+			// We can still use the old self-signed method
+			$ssl_pw = substr(md5(mt_rand()), 0, 6);
+			exec("openssl genrsa -des3 -passout pass:$ssl_pw -out $ssl_key_file 4096");
+			if(AUTOINSTALL){
+				exec("openssl req -new -passin pass:$ssl_pw -passout pass:$ssl_pw -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'])."' -key $ssl_key_file -out $ssl_csr_file");
+			} else {
+				exec("openssl req -new -passin pass:$ssl_pw -passout pass:$ssl_pw -key $ssl_key_file -out $ssl_csr_file");
+			}
+			exec("openssl req -x509 -passin pass:$ssl_pw -passout pass:$ssl_pw -key $ssl_key_file -in $ssl_csr_file -out $ssl_crt_file -days 3650");
+			exec("openssl rsa -passin pass:$ssl_pw -in $ssl_key_file -out $ssl_key_file.insecure");
+			rename($ssl_key_file, $ssl_key_file.'.secure');
+			rename($ssl_key_file.'.insecure', $ssl_key_file);
 		}
-		exec("openssl req -x509 -passin pass:$ssl_pw -passout pass:$ssl_pw -key $ssl_key_file -in $ssl_csr_file -out $ssl_crt_file -days 3650");
-		exec("openssl rsa -passin pass:$ssl_pw -in $ssl_key_file -out $ssl_key_file.insecure");
-		rename($ssl_key_file, $ssl_key_file.'.secure');
-		rename($ssl_key_file.'.insecure', $ssl_key_file);
 
-		exec('chown -R root:root /usr/local/ispconfig/interface/ssl');
+		// Build ispserver.pem file and chmod it
+		exec("cat $ssl_key_file $ssl_crt_file > $ssl_pem_file; chmod 600 $ssl_pem_file");
+
+		// Extend LE SSL certs to postfix
+		if ($conf['postfix']['installed'] == true && strtolower($this->simple_query('Symlink ISPConfig LE SSL certs to postfix?', array('y', 'n'), 'y')) == 'y') {
+
+			// Define folder, file(s)
+			$cf = $conf['postfix'];
+			$postfix_dir = $cf['config_dir'];
+			if(!is_dir($postfix_dir)) $this->error("The postfix configuration directory '$postfix_dir' does not exist.");
+			$smtpd_crt = $postfix_dir.'/smtpd.cert';
+			$smtpd_key = $postfix_dir.'/smtpd.key';
+
+			// Backup existing postfix ssl files
+			if (file_exists($smtpd_crt)) rename($smtpd_crt, $smtpd_crt . '-' .$date->format('YmdHis') . '.bak');
+			if (file_exists($smtpd_key)) rename($smtpd_key, $smtpd_key . '-' .$date->format('YmdHis') . '.bak');
+
+			// Create symlink to ISPConfig SSL files
+			symlink($ssl_crt_file, $smtpd_crt);
+			symlink($ssl_key_file, $smtpd_key);
+		}
+
+		// Extend LE SSL certs to pureftpd
+		if ($conf['pureftpd']['installed'] == true && strtolower($this->simple_query('Symlink ISPConfig LE SSL certs to pureftpd? Creating dhparam file takes some times.', array('y', 'n'), 'y')) == 'y') {
+
+			// Define folder, file(s)
+			$pureftpd_dir = '/etc/ssl/private';
+			if(!is_dir($pureftpd_dir)) mkdir($pureftpd_dir, 0755, true);
+			$pureftpd_pem = $pureftpd_dir.'/pure-ftpd.pem';
+
+			// Backup existing pureftpd ssl files
+			if (file_exists($pureftpd_pem)) rename($pureftpd_pem, $pureftpd_pem . '-' .$date->format('YmdHis') . '.bak');
+
+			// Create symlink to ISPConfig SSL files
+			symlink($ssl_pem_file, $pureftpd_pem);
+			if (!file_exists("$pureftpd_dir/pure-ftpd-dhparams.pem"))
+				exec("cd $pureftpd_dir; openssl dhparam -out dhparam2048.pem 2048; ln -sf dhparam2048.pem pure-ftpd-dhparams.pem");
+		}
+
+		exec("chown -R root:root $ssl_dir");
 
 	}
 
@@ -3107,6 +3354,20 @@ class installer_base {
 		if(!is_link('/usr/local/bin/ispconfig_update_from_dev.sh')) symlink($install_dir.'/server/scripts/ispconfig_update.sh', '/usr/local/bin/ispconfig_update_from_dev.sh');
 		if(!is_link('/usr/local/bin/ispconfig_update.sh')) symlink($install_dir.'/server/scripts/ispconfig_update.sh', '/usr/local/bin/ispconfig_update.sh');
 
+		// Make executable then unlink and symlink letsencrypt pre, post and renew hook scripts
+		chown($install_dir.'/server/scripts/letsencrypt_pre_hook.sh', 'root');
+		chown($install_dir.'/server/scripts/letsencrypt_post_hook.sh', 'root');
+		chown($install_dir.'/server/scripts/letsencrypt_renew_hook.sh', 'root');
+		chmod($install_dir.'/server/scripts/letsencrypt_pre_hook.sh', 0700);
+		chmod($install_dir.'/server/scripts/letsencrypt_post_hook.sh', 0700);
+		chmod($install_dir.'/server/scripts/letsencrypt_renew_hook.sh', 0700);
+		if(is_link('/usr/local/bin/letsencrypt_pre_hook.sh')) unlink('/usr/local/bin/letsencrypt_pre_hook.sh');
+		if(is_link('/usr/local/bin/letsencrypt_post_hook.sh')) unlink('/usr/local/bin/letsencrypt_post_hook.sh');
+		if(is_link('/usr/local/bin/letsencrypt_renew_hook.sh')) unlink('/usr/local/bin/letsencrypt_renew_hook.sh');
+		symlink($install_dir.'/server/scripts/letsencrypt_pre_hook.sh', '/usr/local/bin/letsencrypt_pre_hook.sh');
+		symlink($install_dir.'/server/scripts/letsencrypt_post_hook.sh', '/usr/local/bin/letsencrypt_post_hook.sh');
+		symlink($install_dir.'/server/scripts/letsencrypt_renew_hook.sh', '/usr/local/bin/letsencrypt_renew_hook.sh');
+
 		//* Make the logs readable for the ispconfig user
 		if(@is_file('/var/log/mail.log')) exec('chmod +r /var/log/mail.log');
 		if(@is_file('/var/log/mail.warn')) exec('chmod +r /var/log/mail.warn');
@@ -3447,5 +3708,3 @@ class installer_base {
 	}
 
 }
-
-?>
diff --git a/install/lib/mysql.lib.php b/install/lib/mysql.lib.php
index c24a454d040e0d5bb6b4d8b613da99a9aae04158..1085ed0d5b2c04cd97bcc5968f371afec5e0dc35 100644
--- a/install/lib/mysql.lib.php
+++ b/install/lib/mysql.lib.php
@@ -761,6 +761,41 @@ class db
 			break;
 		}
 	}
+	
+	/**
+	 * Get the database type (mariadb or mysql)
+	 *
+	 * @access public
+	 * @return string 'mariadb' or string 'mysql'
+	 */
+	
+	public function getDatabaseType() {
+		$tmp = $this->queryOneRecord('SELECT VERSION() as version');
+		if(stristr($tmp['version'],'mariadb')) {
+			return 'mariadb';
+		} else {
+			return 'mysql';
+		}
+	}
+	
+	/**
+	 * Get the database version
+	 *
+	 * @access public
+	 * @param bool   $major_version_only = true will return the major version only, e.g. 8 for MySQL 8
+	 * @return string version number
+	 */
+	
+	public function getDatabaseVersion($major_version_only = false) {
+		$tmp = $this->queryOneRecord('SELECT VERSION() as version');
+		$version = explode('-', $tmp['version']);
+		if($major_version_only == true) {
+			$version_parts = explode('.', $version[0]);
+			return $version_parts[0];
+		} else {
+			return $version[0];
+		}
+	}
 
 }
 
diff --git a/install/sql/incremental/upd_0089.sql b/install/sql/incremental/upd_0089.sql
new file mode 100644
index 0000000000000000000000000000000000000000..08ae33e1705dc532483a86ef10834147898c221f
--- /dev/null
+++ b/install/sql/incremental/upd_0089.sql
@@ -0,0 +1,77 @@
+-- add new proxy_protocol column
+ALTER TABLE `web_domain`
+    ADD COLUMN `proxy_protocol` ENUM('n','y') NOT NULL DEFAULT 'n' AFTER `log_retention`;
+
+-- backup format
+ALTER TABLE `web_domain` ADD  `backup_format_web` VARCHAR( 255 ) NOT NULL default 'default' AFTER `backup_copies`;
+ALTER TABLE `web_domain` ADD  `backup_format_db` VARCHAR( 255 ) NOT NULL default 'gzip' AFTER `backup_format_web`;
+-- end of backup format
+
+-- backup encryption
+ALTER TABLE `web_domain` ADD  `backup_encrypt` enum('n','y') NOT NULL DEFAULT 'n' AFTER `backup_format_db`;
+ALTER TABLE `web_domain` ADD  `backup_password` VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `backup_encrypt`;
+ALTER TABLE `web_backup` ADD  `backup_format` VARCHAR( 64 ) NOT NULL DEFAULT '' AFTER `backup_mode`;
+ALTER TABLE `web_backup` ADD  `backup_password` VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `filesize`;
+-- end of backup encryption
+
+-- rename Comodo to "Sectigo / Comodo CA"
+UPDATE `dns_ssl_ca` SET `ca_name` = 'Sectigo / Comodo CA' WHERE `ca_issue` = 'comodoca.com';
+
+-- default php-fpm to ondemand mode
+ALTER TABLE `web_domain` ALTER pm SET DEFAULT 'ondemand';
+
+ALTER TABLE `mail_user`
+  ADD `purge_trash_days` INT NOT NULL DEFAULT '0' AFTER `move_junk`,
+  ADD `purge_junk_days` INT NOT NULL DEFAULT '0' AFTER `purge_trash_days`;
+
+-- doveadm should be enabled for all mailboxes
+UPDATE `mail_user` set `disabledoveadm` = 'n';
+
+-- add disablequota-status for quota-status policy daemon
+ALTER TABLE `mail_user` ADD `disablequota-status` ENUM('n','y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'n' AFTER `disabledoveadm`;
+
+-- add disableindexer-worker for solr search
+ALTER TABLE `mail_user` ADD `disableindexer-worker` ENUM('n','y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'n' AFTER `disablequota-status`;
+
+-- add SSHFP and DNAME record
+ALTER TABLE `dns_rr` CHANGE `type` `type` ENUM('A','AAAA','ALIAS','CNAME','DNAME','CAA','DS','HINFO','LOC','MX','NAPTR','NS','PTR','RP','SRV','SSHFP','TXT','TLSA','DNSKEY') NULL DEFAULT NULL AFTER `name`;
+
+-- change cc and sender_cc column type
+ALTER TABLE `mail_user` CHANGE `cc` `cc` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci;
+
+-- remove SPDY option
+ALTER TABLE `web_domain` DROP COLUMN `enable_spdy`;
+
+-- was missing in incremental, inserted for fixing older installations
+ALTER TABLE `web_domain` ADD `folder_directive_snippets` TEXT NULL AFTER `https_port`;
+
+ALTER TABLE `web_domain` ADD `server_php_id` INT(11) UNSIGNED NOT NULL DEFAULT 0;
+
+UPDATE `web_domain` as w LEFT JOIN sys_group as g ON (g.groupid = w.sys_groupid) INNER JOIN `server_php` as p ON (w.fastcgi_php_version = CONCAT(p.name, ':', p.php_fastcgi_binary, ':', p.php_fastcgi_ini_dir) AND p.server_id IN (0, w.server_id) AND p.client_id IN (0, g.client_id)) SET w.server_php_id = p.server_php_id, w.fastcgi_php_version = '' WHERE 1;
+
+UPDATE `web_domain` as w LEFT JOIN sys_group as g ON (g.groupid = w.sys_groupid) INNER JOIN `server_php` as p ON (w.fastcgi_php_version = CONCAT(p.name, ':', p.php_fpm_init_script, ':', p.php_fpm_ini_dir, ':', p.php_fpm_pool_dir) AND p.server_id IN (0, w.server_id) AND p.client_id IN (0, g.client_id)) SET w.server_php_id = p.server_php_id, w.fastcgi_php_version = '' WHERE 1;
+
+ALTER TABLE `web_domain` CHANGE `apache_directives` `apache_directives` mediumtext NULL DEFAULT NULL;
+ALTER TABLE `web_domain` CHANGE `nginx_directives` `nginx_directives` mediumtext NULL DEFAULT NULL;
+
+-- add move to junk before/after option, default to after
+ALTER TABLE `mail_user` MODIFY `move_junk` enum('y','a','n') NOT NULL DEFAULT 'y';
+
+-- Change id_rsa column to TEXT format
+ALTER TABLE `client` CHANGE `id_rsa` `id_rsa` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci;
+
+ALTER TABLE `directive_snippets` ADD `update_sites` ENUM('y','n') NOT NULL DEFAULT 'n' ;
+
+-- Add DNSSEC Algorithm setting
+ALTER TABLE `dns_soa` ADD `dnssec_algo` SET('NSEC3RSASHA1','ECDSAP256SHA256') NULL DEFAULT NULL AFTER `dnssec_wanted`;
+UPDATE `dns_soa` SET `dnssec_algo` = 'NSEC3RSASHA1' WHERE `dnssec_algo` IS NULL AND dnssec_initialized = 'Y';
+UPDATE `dns_soa` SET `dnssec_algo` = 'ECDSAP256SHA256' WHERE `dnssec_algo` IS NULL AND dnssec_initialized = 'N';
+ALTER TABLE `dns_soa` CHANGE `dnssec_algo` `dnssec_algo` SET('NSEC3RSASHA1','ECDSAP256SHA256') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'ECDSAP256SHA256';
+
+-- Fix issue #5635
+ALTER TABLE `client_template` CHANGE `ssh_chroot` `ssh_chroot` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '';
+ALTER TABLE `client_template` CHANGE `web_php_options` `web_php_options` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '';
+
+-- add option to forward in lda, default to forward in mta except for existing forwards
+ALTER TABLE `mail_user` ADD `forward_in_lda` enum('n','y') NOT NULL default 'n' AFTER `cc`;
+UPDATE `mail_user` set `forward_in_lda` = 'y' where `cc` != '';
\ No newline at end of file
diff --git a/install/sql/incremental/upd_dev_collection.sql b/install/sql/incremental/upd_dev_collection.sql
index f6bd9982f798916b7a214dd7b878995730ac41a8..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644
--- a/install/sql/incremental/upd_dev_collection.sql
+++ b/install/sql/incremental/upd_dev_collection.sql
@@ -1,78 +0,0 @@
--- add new proxy_protocol column
-ALTER TABLE `web_domain`
-    ADD COLUMN `proxy_protocol` ENUM('n','y') NOT NULL DEFAULT 'n' AFTER `log_retention`;
-
--- backup format
-ALTER TABLE `web_domain` ADD  `backup_format_web` VARCHAR( 255 ) NOT NULL default 'default' AFTER `backup_copies`;
-ALTER TABLE `web_domain` ADD  `backup_format_db` VARCHAR( 255 ) NOT NULL default 'gzip' AFTER `backup_format_web`;
--- end of backup format
-
--- backup encryption
-ALTER TABLE `web_domain` ADD  `backup_encrypt` enum('n','y') NOT NULL DEFAULT 'n' AFTER `backup_format_db`;
-ALTER TABLE `web_domain` ADD  `backup_password` VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `backup_encrypt`;
-ALTER TABLE `web_backup` ADD  `backup_format` VARCHAR( 64 ) NOT NULL DEFAULT '' AFTER `backup_mode`;
-ALTER TABLE `web_backup` ADD  `backup_password` VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `filesize`;
--- end of backup encryption
-
--- rename Comodo to "Sectigo / Comodo CA"
-UPDATE `dns_ssl_ca` SET `ca_name` = 'Sectigo / Comodo CA' WHERE `ca_issue` = 'comodoca.com';
-
--- default php-fpm to ondemand mode
-ALTER TABLE `web_domain` ALTER pm SET DEFAULT 'ondemand';
-
-ALTER TABLE `mail_user`
-  ADD `purge_trash_days` INT NOT NULL DEFAULT '0' AFTER `move_junk`,
-  ADD `purge_junk_days` INT NOT NULL DEFAULT '0' AFTER `purge_trash_days`;
-
--- doveadm should be enabled for all mailboxes
-UPDATE `mail_user` set `disabledoveadm` = 'n';
-
--- add disablequota-status for quota-status policy daemon
-ALTER TABLE `mail_user` ADD `disablequota-status` ENUM('n','y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'n' AFTER `disabledoveadm`;
-
--- add disableindexer-worker for solr search
-ALTER TABLE `mail_user` ADD `disableindexer-worker` ENUM('n','y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'n' AFTER `disablequota-status`;
-
--- add SSHFP and DNAME record
-ALTER TABLE `dns_rr` CHANGE `type` `type` ENUM('A','AAAA','ALIAS','CNAME','DNAME','CAA','DS','HINFO','LOC','MX','NAPTR','NS','PTR','RP','SRV','SSHFP','TXT','TLSA','DNSKEY') NULL DEFAULT NULL AFTER `name`;
-
--- change cc and sender_cc column type
-ALTER TABLE `mail_user` CHANGE `cc` `cc` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '';
-
--- remove SPDY option
-ALTER TABLE `web_domain` DROP COLUMN `enable_spdy`;
-
--- was missing in incremental, inserted for fixing older installations
-ALTER TABLE `web_domain` ADD `folder_directive_snippets` TEXT NULL AFTER `https_port`;
-
-
-ALTER TABLE `web_domain` ADD `server_php_id` INT(11) UNSIGNED NOT NULL DEFAULT 0;
-
-UPDATE `web_domain` as w LEFT JOIN sys_group as g ON (g.groupid = w.sys_groupid) INNER JOIN `server_php` as p ON (w.fastcgi_php_version = CONCAT(p.name, ':', p.php_fastcgi_binary, ':', p.php_fastcgi_ini_dir) AND p.server_id IN (0, w.server_id) AND p.client_id IN (0, g.client_id)) SET w.server_php_id = p.server_php_id, w.fastcgi_php_version = '' WHERE 1;
-
-UPDATE `web_domain` as w LEFT JOIN sys_group as g ON (g.groupid = w.sys_groupid) INNER JOIN `server_php` as p ON (w.fastcgi_php_version = CONCAT(p.name, ':', p.php_fpm_init_script, ':', p.php_fpm_ini_dir, ':', p.php_fpm_pool_dir) AND p.server_id IN (0, w.server_id) AND p.client_id IN (0, g.client_id)) SET w.server_php_id = p.server_php_id, w.fastcgi_php_version = '' WHERE 1;
-
--- we have to decide whether to delete the column or leave it there for investigating not-converted entries
--- ALTER TABLE `web_domain` DROP COLUMN `fastcgi_php_version`;
-
-ALTER TABLE `web_domain` CHANGE `apache_directives` `apache_directives` mediumtext NULL DEFAULT NULL;
-ALTER TABLE `web_domain` CHANGE `nginx_directives` `nginx_directives` mediumtext NULL DEFAULT NULL;
-
--- add move to junk before/after option, default to after
-ALTER TABLE `mail_user` MODIFY `move_junk` enum('y','a','n') NOT NULL DEFAULT 'y';
-
--- Change id_rsa column to TEXT format
-ALTER TABLE `client` CHANGE `id_rsa` `id_rsa` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '';
-
-ALTER TABLE `directive_snippets` ADD `update_sites` ENUM('y','n') NOT NULL DEFAULT 'n' ;
-
--- Add DNSSEC Algorithm setting
-ALTER TABLE `dns_soa` ADD `dnssec_algo` SET('NSEC3RSASHA1','ECDSAP256SHA256') NULL DEFAULT NULL AFTER `dnssec_wanted`;
-UPDATE `dns_soa` SET `dnssec_algo` = 'NSEC3RSASHA1' WHERE `dnssec_algo` IS NULL AND dnssec_initialized = 'Y';
-UPDATE `dns_soa` SET `dnssec_algo` = 'ECDSAP256SHA256' WHERE `dnssec_algo` IS NULL AND dnssec_initialized = 'N';
-ALTER TABLE `dns_soa` CHANGE `dnssec_algo` `dnssec_algo` SET('NSEC3RSASHA1','ECDSAP256SHA256') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'ECDSAP256SHA256';
-
--- Fix issue #5635
-ALTER TABLE `client_template` CHANGE `ssh_chroot` `ssh_chroot` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '';
-ALTER TABLE `client_template` CHANGE `web_php_options` `web_php_options` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '';
-
diff --git a/install/sql/ispconfig3.sql b/install/sql/ispconfig3.sql
index 095a2d37de445c0fbeec796055d3fb685355fb64..08fa18c371b1e43d324e8330507ee0a462a7c582 100644
--- a/install/sql/ispconfig3.sql
+++ b/install/sql/ispconfig3.sql
@@ -253,7 +253,7 @@ CREATE TABLE `client` (
   `canceled` enum('n','y') NOT NULL DEFAULT 'n',
   `can_use_api` enum('n','y') NOT NULL DEFAULT 'n',
   `tmp_data` mediumblob,
-  `id_rsa` text NOT NULL DEFAULT '',
+  `id_rsa` text,
   `ssh_rsa` varchar(600) NOT NULL DEFAULT '',
   `customer_no_template` varchar(255) DEFAULT 'R[CLIENTID]C[CUSTOMER_NO]',
   `customer_no_start` int(11) NOT NULL DEFAULT '1',
@@ -1040,7 +1040,8 @@ CREATE TABLE `mail_user` (
   `maildir` varchar(255) NOT NULL default '',
   `maildir_format` varchar(255) NOT NULL default 'maildir',
   `quota` bigint(20) NOT NULL default '-1',
-  `cc` text NOT NULL default '',
+  `cc` text,
+  `forward_in_lda` enum('n','y') NOT NULL default 'n',
   `sender_cc` varchar(255) NOT NULL default '',
   `homedir` varchar(255) NOT NULL default '',
   `autoresponder` enum('n','y') NOT NULL default 'n',
diff --git a/install/tpl/mysql-virtual_email2email.cf.master b/install/tpl/mysql-virtual_email2email.cf.master
index 17e1cdf0bf93c91370183d62947d277b54e02015..87553d5f9d8ce8b121c47fa96b5acb11a573e712 100644
--- a/install/tpl/mysql-virtual_email2email.cf.master
+++ b/install/tpl/mysql-virtual_email2email.cf.master
@@ -2,6 +2,4 @@ user = {mysql_server_ispconfig_user}
 password = {mysql_server_ispconfig_password}
 dbname = {mysql_server_database}
 hosts = {mysql_server_ip}
-query = SELECT email FROM mail_user WHERE email = '%s' AND postfix = 'y' AND disabledeliver = 'n' AND server_id = {server_id}
-        UNION
-        SELECT cc AS email FROM mail_user WHERE email = '%s' AND postfix = 'y' AND disabledeliver = 'y' AND server_id = {server_id}
+query = SELECT cc AS email FROM mail_user WHERE email = '%s' AND cc != '' AND (forward_in_lda = 'n' OR disabledeliver = 'y') AND postfix = 'y' AND server_id = {server_id}
diff --git a/install/tpl/mysql-virtual_mailboxes.cf.master b/install/tpl/mysql-virtual_mailboxes.cf.master
index 97825f9ffc9c492e68f8703efce25f00b79d66e7..281bedb07b531177f46a0e13a208ddc4c955bfb1 100644
--- a/install/tpl/mysql-virtual_mailboxes.cf.master
+++ b/install/tpl/mysql-virtual_mailboxes.cf.master
@@ -2,4 +2,4 @@ user = {mysql_server_ispconfig_user}
 password = {mysql_server_ispconfig_password}
 dbname = {mysql_server_database}
 hosts = {mysql_server_ip}
-query = select CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/') from mail_user where login = '%s' and postfix = 'y' and server_id = {server_id}
+query = select CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/') from mail_user where login = '%s' and postfix = 'y' and disabledeliver = 'n' and server_id = {server_id}
diff --git a/install/uninstall.php b/install/uninstall.php
index fdac79d61ec3800f994e8e2e4014ca5e86960399..37cbe05f866a8cce939551f2f290c5cbb965cb91 100644
--- a/install/uninstall.php
+++ b/install/uninstall.php
@@ -88,6 +88,9 @@ if($do_uninstall == 'yes') {
 	exec('rm -rf /usr/local/ispconfig');
 
 	// Delete various other files
+	@unlink("/usr/local/bin/letsencrypt_post_hook.sh");
+	@unlink("/usr/local/bin/letsencrypt_pre_hook.sh");
+	@unlink("/usr/local/bin/letsencrypt_renew_hook.sh");
 	@unlink("/usr/local/bin/ispconfig_update.sh");
 	@unlink("/usr/local/bin/ispconfig_update_from_svn.sh");
 	@unlink("/var/spool/mail/ispconfig");
diff --git a/install/update.php b/install/update.php
index 3b3cf969ef3cefa8e8ad76c6eed31a0da75969e0..f0ac80c14ba50fb8aafbd1739dc3661d4c053a73 100644
--- a/install/update.php
+++ b/install/update.php
@@ -188,6 +188,8 @@ $inst = new installer();
 if (!$inst->get_php_version()) die('ISPConfig requieres PHP '.$inst->min_php."\n");
 $inst->is_update = true;
 
+$inst->check_prerequisites();
+
 echo "This application will update ISPConfig 3 on your server.\n\n";
 
 //* Make a backup before we start the update
@@ -534,6 +536,12 @@ if ($inst->install_ispconfig_interface) {
 	}
 }
 
+// Create SSL certs for non-webserver(s)?
+if(!file_exists('/usr/local/ispconfig/interface/ssl/ispserver.crt')) {
+    if(strtolower($inst->simple_query('Do you want to create SSL certs for your server?', array('y', 'n'), 'y')) == 'y')
+        $inst->make_ispconfig_ssl_cert();
+}
+
 $inst->install_ispconfig();
 
 // Cleanup
diff --git a/interface/lib/classes/db_mysql.inc.php b/interface/lib/classes/db_mysql.inc.php
index 014feec8c319cef6fa5585c5cc91fc3185cc5490..feab66cd936bbbbb8df15d49e39c9564fb13e6b0 100644
--- a/interface/lib/classes/db_mysql.inc.php
+++ b/interface/lib/classes/db_mysql.inc.php
@@ -1106,6 +1106,76 @@ class db
 		}
 	}
 
+	/**
+	 * Get the database type (mariadb or mysql)
+	 *
+	 * @access public
+	 * @return string 'mariadb' or string 'mysql'
+	 */
+	
+	public function getDatabaseType() {
+		$tmp = $this->queryOneRecord('SELECT VERSION() as version');
+		if(stristr($tmp['version'],'mariadb')) {
+			return 'mariadb';
+		} else {
+			return 'mysql';
+		}
+	}
+
+	/**
+	 * Get the database version
+	 *
+	 * @access public
+	 * @param bool   $major_version_only = true will return the major version only, e.g. 8 for MySQL 8
+	 * @return string version number
+	 */
+
+	public function getDatabaseVersion($major_version_only = false) {
+		$tmp = $this->queryOneRecord('SELECT VERSION() as version');
+		$version = explode('-', $tmp['version']);
+		if($major_version_only == true) {
+			$version_parts = explode('.', $version[0]);
+			return $version_parts[0];
+		} else {
+			return $version[0];
+		}
+	}
+	
+	/**
+	 * Get a mysql password hash
+	 *
+	 * @access public
+	 * @param string   cleartext password
+	 * @return string  Password hash
+	 */
+
+	public function getPasswordHash($password) {
+		
+		$password_type = 'password';
+		
+		/* Disabled until caching_sha2_password is implemented
+		if($this->getDatabaseType() == 'mysql' && $this->getDatabaseVersion(true) >= 8) {
+			// we are in MySQL 8 mode
+			$tmp = $this->queryOneRecord("show variables like 'default_authentication_plugin'");
+			if($tmp['default_authentication_plugin'] == 'caching_sha2_password') {
+				$password_type = 'caching_sha2_password';
+			}
+		}
+		*/
+		
+		if($password_type == 'caching_sha2_password') {
+			/*
+				caching_sha2_password hashing needs to be implemented, have not 
+				found valid PHP implementation for the new password hash type.
+			*/
+		} else {
+			$password_hash = '*'.strtoupper(sha1(sha1($password, true)));
+		}
+		
+		return $password_hash;
+	}
+
+
 }
 
 /**
diff --git a/interface/lib/classes/tform_base.inc.php b/interface/lib/classes/tform_base.inc.php
index cbbb83ee9c7d8ee9860725c5650ecb80f1ace805..91a855872c9600939ac338f2b5cbe5bd11513d73 100644
--- a/interface/lib/classes/tform_base.inc.php
+++ b/interface/lib/classes/tform_base.inc.php
@@ -1358,8 +1358,7 @@ class tform_base {
 								$record[$key] = $app->auth->crypt_password(stripslashes($record[$key]),'ISO-8859-1');
 								$sql_insert_val .= "'".$app->db->quote($record[$key])."', ";
 							} elseif (isset($field['encryption']) && $field['encryption'] == 'MYSQL') {
-								$tmp = $app->db->queryOneRecord("SELECT PASSWORD(?) as `crypted`", stripslashes($record[$key]));
-								$record[$key] = $tmp['crypted'];
+								$record[$key] = $app->db->getPasswordHash($record[$key]);
 								$sql_insert_val .= "'".$app->db->quote($record[$key])."', ";
 							} else {
 								$record[$key] = md5(stripslashes($record[$key]));
@@ -1390,8 +1389,7 @@ class tform_base {
 								$record[$key] = $app->auth->crypt_password(stripslashes($record[$key]),'ISO-8859-1');
 								$sql_update .= "`$key` = '".$app->db->quote($record[$key])."', ";
 							} elseif (isset($field['encryption']) && $field['encryption'] == 'MYSQL') {
-								$tmp = $app->db->queryOneRecord("SELECT PASSWORD(?) as `crypted`", stripslashes($record[$key]));
-								$record[$key] = $tmp['crypted'];
+								$record[$key] = $app->db->getPasswordHash($record[$key]);
 								$sql_update .= "`$key` = '".$app->db->quote($record[$key])."', ";
 							} else {
 								$record[$key] = md5(stripslashes($record[$key]));
diff --git a/interface/web/mail/form/mail_user.tform.php b/interface/web/mail/form/mail_user.tform.php
index 67330f465860f0c129ea319c1ee8acdbd1429761..85e310648b23d2942360aadbea9614cfebeb5862 100644
--- a/interface/web/mail/form/mail_user.tform.php
+++ b/interface/web/mail/form/mail_user.tform.php
@@ -189,6 +189,12 @@ $form["tabs"]['mailuser'] = array(
 			'width'  => '30',
 			'maxlength' => '65535'
 		),
+		'forward_in_lda' => array (
+			'datatype' => 'VARCHAR',
+			'formtype' => 'CHECKBOX',
+			'default' => 'n',
+			'value'  => array(0 => 'n', 1 => 'y')
+		),
 		'sender_cc' => array (
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
diff --git a/interface/web/mail/lib/lang/ar_mail_user.lng b/interface/web/mail/lib/lang/ar_mail_user.lng
index 829de6a749ee61bdebeb6f6bb27e8e37fea648cf..88b89d0fb417547f00e15857f30c6d9087286b12 100644
--- a/interface/web/mail/lib/lang/ar_mail_user.lng
+++ b/interface/web/mail/lib/lang/ar_mail_user.lng
@@ -40,6 +40,8 @@ $wb['name_optional_txt'] = '(Optional)';
 $wb['autoresponder_active'] = 'Enable the autoresponder';
 $wb['cc_txt'] = 'Send copy to';
 $wb['cc_error_isemail'] = 'The Send copy to field does not conatin a valid email address';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 $wb['domain_txt'] = 'Domain';
 $wb['now_txt'] = 'Now';
 $wb['login_error_unique'] = 'Login is already taken.';
diff --git a/interface/web/mail/lib/lang/bg_mail_user.lng b/interface/web/mail/lib/lang/bg_mail_user.lng
index 126ec603d22d3d754816487e7881e22ff20ed77d..bee86d8d3194fca098db9f028bb334c03b264692 100644
--- a/interface/web/mail/lib/lang/bg_mail_user.lng
+++ b/interface/web/mail/lib/lang/bg_mail_user.lng
@@ -40,6 +40,8 @@ $wb['name_optional_txt'] = '(По желание)';
 $wb['autoresponder_active'] = 'Разреши автоматичен отговор';
 $wb['cc_txt'] = 'Изпрати копие до:';
 $wb['cc_error_isemail'] = 'Полето с Изпрати копие до: не съдържа валиден емайл адрес';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 $wb['domain_txt'] = 'Домейн';
 $wb['now_txt'] = 'Сега';
 $wb['login_error_unique'] = 'Login is already taken.';
diff --git a/interface/web/mail/lib/lang/br_mail_user.lng b/interface/web/mail/lib/lang/br_mail_user.lng
index 8e3edd6950c29b2420f8f10d5f4dc54cbbb023f7..8d72534d6b027c9b1162a1b90129bc10246a9b7b 100644
--- a/interface/web/mail/lib/lang/br_mail_user.lng
+++ b/interface/web/mail/lib/lang/br_mail_user.lng
@@ -46,8 +46,10 @@ $wb['name_txt'] = 'Nome';
 $wb['name_optional_txt'] = '(Opcional)';
 $wb['autoresponder_active'] = 'Habilitar auto-resposta';
 $wb['cc_txt'] = 'Enviar cópia para';
-$wb['sender_cc_txt'] = 'Enviar cópia oculta (BCC) para';
 $wb['cc_error_isemail'] = 'O campo "Enviar cópia para" contém um endereço de e-mail inválido.';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
+$wb['sender_cc_txt'] = 'Enviar cópia oculta (BCC) para';
 $wb['sender_cc_error_isemail'] = 'O campo "Enviar cópia oculta para" contém um endereço de e-mail inválido.';
 $wb['domain_txt'] = 'Domínio';
 $wb['now_txt'] = 'Agora';
diff --git a/interface/web/mail/lib/lang/ca_mail_user.lng b/interface/web/mail/lib/lang/ca_mail_user.lng
index 7fd4263e976aaa94d92480bd5c28401c4e977aa5..a0afb01ee310bc7f92cb5785f8dee6259581e07d 100644
--- a/interface/web/mail/lib/lang/ca_mail_user.lng
+++ b/interface/web/mail/lib/lang/ca_mail_user.lng
@@ -39,6 +39,8 @@ $wb['name_optional_txt'] = '(Optionnel)';
 $wb['autoresponder_active'] = 'Activer le répondeur automatique';
 $wb['cc_txt'] = 'Envoyer une copie à';
 $wb['cc_error_isemail'] = 'Le champ Envoyer une copie ne contient pas une adresse courriel valide';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 $wb['domain_txt'] = 'Domaine';
 $wb['now_txt'] = 'Maintenant';
 $wb['login_error_unique'] = 'Ce nom d\'utilisateur est déjà pris.';
diff --git a/interface/web/mail/lib/lang/cz_mail_user.lng b/interface/web/mail/lib/lang/cz_mail_user.lng
index 835f2918c1dc2589745fe9c8cea89367dd523c53..0b5f73080c3abc3bb13d7e03fc82ea76d4535b88 100644
--- a/interface/web/mail/lib/lang/cz_mail_user.lng
+++ b/interface/web/mail/lib/lang/cz_mail_user.lng
@@ -39,6 +39,8 @@ $wb['name_optional_txt'] = '(volitelné)';
 $wb['autoresponder_active'] = 'Povolit automatický odpovídač';
 $wb['cc_txt'] = 'Odeslat příchozí kopii na';
 $wb['cc_error_isemail'] = 'Adresa uvedená v poli zaslat kopii na je neplatná';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 $wb['domain_txt'] = 'Doména';
 $wb['now_txt'] = 'Nyní';
 $wb['login_error_unique'] = 'Přihlášovací jméno je již obsazeno.';
diff --git a/interface/web/mail/lib/lang/de_mail_user.lng b/interface/web/mail/lib/lang/de_mail_user.lng
index dbbf54d1501fb689b480843c1a05ceba6d0658f5..c99abe8e8d5a06e3659e3a47c69872d28c2c7680 100644
--- a/interface/web/mail/lib/lang/de_mail_user.lng
+++ b/interface/web/mail/lib/lang/de_mail_user.lng
@@ -46,6 +46,8 @@ $wb['name_optional_txt'] = '(optional)';
 $wb['autoresponder_active'] = 'Autoresponder aktivieren';
 $wb['cc_txt'] = 'Eingehende Mails in Kopie senden an';
 $wb['cc_error_isemail'] = 'Das Feld "Kopie senden an" enthält keine gültige E-Mail Adresse';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 $wb['login_error_unique'] = 'Benutzername wird bereits verwendet.';
 $wb['login_error_regex'] = 'Zulässige Zeichen sind A-Z, a-z, 0-9, ., _ und -.';
 $wb['login_txt'] = 'Anmelden';
diff --git a/interface/web/mail/lib/lang/dk_mail_user.lng b/interface/web/mail/lib/lang/dk_mail_user.lng
index 04196d6b29011205d481a692024fec4dc4bf8292..36487cd836248ddd0d21ade098a5509afa2d3052 100644
--- a/interface/web/mail/lib/lang/dk_mail_user.lng
+++ b/interface/web/mail/lib/lang/dk_mail_user.lng
@@ -45,6 +45,8 @@ $wb['name_optional_txt'] = '(Valgfri)';
 $wb['autoresponder_active'] = 'Aktiver autosvarer';
 $wb['cc_txt'] = 'Send kopi til';
 $wb['cc_error_isemail'] = '-Send kopi til- felt indeholder ikke en gyldig e-mail adresse';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 $wb['domain_txt'] = 'Domæne';
 $wb['now_txt'] = 'Nu';
 $wb['login_error_unique'] = 'Log ind er allerede taget.';
diff --git a/interface/web/mail/lib/lang/el_mail_user.lng b/interface/web/mail/lib/lang/el_mail_user.lng
index b273f6b8145af328adfd6aa6a5d8d3a11181f3ab..9c53de9fe3de3f350e6cb65228c82dcf6a53bb4f 100644
--- a/interface/web/mail/lib/lang/el_mail_user.lng
+++ b/interface/web/mail/lib/lang/el_mail_user.lng
@@ -40,6 +40,8 @@ $wb['name_optional_txt'] = '(Προαιρετικό)';
 $wb['autoresponder_active'] = 'Ενεργοποίηση αυτόματης απάντησης';
 $wb['cc_txt'] = 'Αποστολή αντιγράφου σε ';
 $wb['cc_error_isemail'] = 'Προς';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 $wb['domain_txt'] = 'Domain';
 $wb['now_txt'] = 'Τώρα';
 $wb['login_error_unique'] = 'Το όνομα χρησιμοποιείται ήδη';
diff --git a/interface/web/mail/lib/lang/en_mail_user.lng b/interface/web/mail/lib/lang/en_mail_user.lng
index ed6b6e3bd326669b25b117563e86a31eefcc89f8..ead8a2a0339a3db95fe058dfd09fbbf825e6107e 100644
--- a/interface/web/mail/lib/lang/en_mail_user.lng
+++ b/interface/web/mail/lib/lang/en_mail_user.lng
@@ -46,8 +46,10 @@ $wb["name_txt"] = 'Name';
 $wb["name_optional_txt"] = '(Optional)';
 $wb['autoresponder_active'] = 'Enable the autoresponder';
 $wb['cc_txt'] = 'Send copy to';
-$wb['sender_cc_txt'] = 'Send outgoing BCC to';
 $wb['cc_error_isemail'] = 'The -Send copy to- field does not contain a valid email address';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
+$wb['sender_cc_txt'] = 'Send outgoing BCC to';
 $wb['sender_cc_error_isemail'] = 'The -Send outgoing copy to- field does not contain a valid email address';
 $wb['domain_txt'] = 'Domain';
 $wb['now_txt']='Now';
diff --git a/interface/web/mail/lib/lang/es_mail_user.lng b/interface/web/mail/lib/lang/es_mail_user.lng
index 6757df0854e68d5f47114734fce062c7130227ed..00f9074c1c80a991d9b87f5aca0985378104f0be 100644
--- a/interface/web/mail/lib/lang/es_mail_user.lng
+++ b/interface/web/mail/lib/lang/es_mail_user.lng
@@ -12,9 +12,11 @@ $wb['autoresponder_text_txt'] = 'Texto';
 $wb['autoresponder_txt'] = 'Habilitado';
 $wb['backup_copies_txt'] = 'Número de copias de seguridad';
 $wb['backup_interval_txt'] = 'Intervalo de copias de seguridad';
-$wb['cc_error_isemail'] = 'El campo -Enviar copia a- no contiene una dirección de correo válida.';
 $wb['cc_note_txt'] = '(Separe múltiples cuentas de correo con comas)';
 $wb['cc_txt'] = 'Enviar copia a';
+$wb['cc_error_isemail'] = 'El campo -Enviar copia a- no contiene una dirección de correo válida.';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 $wb['cryptpwd_txt'] = 'Contraseña';
 $wb['custom_mailfilter_txt'] = 'Filtro de correo personalizado';
 $wb['daily_backup_txt'] = 'Diariamente';
diff --git a/interface/web/mail/lib/lang/fi_mail_user.lng b/interface/web/mail/lib/lang/fi_mail_user.lng
index ed3635c1ae8d7337f189604609e5cab5709e91f8..6f06d655c456a128ddf73b9062d6c4a7350ed96e 100644
--- a/interface/web/mail/lib/lang/fi_mail_user.lng
+++ b/interface/web/mail/lib/lang/fi_mail_user.lng
@@ -40,6 +40,8 @@ $wb['name_optional_txt'] = '(Valinnainen)';
 $wb['autoresponder_active'] = 'Ota lomavastaaja käyttöön';
 $wb['cc_txt'] = 'Send copy to';
 $wb['cc_error_isemail'] = 'The Send copy to field does not conatin a valid email address';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 $wb['domain_txt'] = 'Domain';
 $wb['now_txt'] = 'Now';
 $wb['login_error_unique'] = 'Login is already taken.';
diff --git a/interface/web/mail/lib/lang/fr_mail_user.lng b/interface/web/mail/lib/lang/fr_mail_user.lng
index cce8f0a8a16c1dfac899912fd074e08966bc26f6..8c5cb44fbd24e4250ee6e7c434b23ae373afed89 100644
--- a/interface/web/mail/lib/lang/fr_mail_user.lng
+++ b/interface/web/mail/lib/lang/fr_mail_user.lng
@@ -39,6 +39,8 @@ $wb['name_optional_txt'] = '(Optionnel)';
 $wb['autoresponder_active'] = 'Activer le répondeur automatique';
 $wb['cc_txt'] = 'Envoyer une copie à';
 $wb['cc_error_isemail'] = 'Le champ Envoyer une copie ne contient pas une adresse e-mail valide';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 $wb['domain_txt'] = 'Domaine';
 $wb['now_txt'] = 'Maintenant';
 $wb['login_error_unique'] = 'Ce nom d’utilisateur est déjà pris.';
diff --git a/interface/web/mail/lib/lang/hr_mail_user.lng b/interface/web/mail/lib/lang/hr_mail_user.lng
index 0cb1b91849c50d752b0d3a3ddd9da442d0dc0cea..0a7feb9c38888758964b7024be71bd620acf8e77 100644
--- a/interface/web/mail/lib/lang/hr_mail_user.lng
+++ b/interface/web/mail/lib/lang/hr_mail_user.lng
@@ -40,6 +40,8 @@ $wb['name_optional_txt'] = '(Optional)';
 $wb['autoresponder_active'] = 'Enable the autoresponder';
 $wb['cc_txt'] = 'Send copy to';
 $wb['cc_error_isemail'] = 'The -Send copy to- field does not conatin a valid email address';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 $wb['domain_txt'] = 'Domena';
 $wb['now_txt'] = 'Now';
 $wb['login_error_unique'] = 'Login is already taken.';
diff --git a/interface/web/mail/lib/lang/hu_mail_user.lng b/interface/web/mail/lib/lang/hu_mail_user.lng
index 610f40b4ba8b0342590967991a9512ae97d19d55..09a0d7a8de5e00a98ea28c4bdd39915d95d9afb5 100644
--- a/interface/web/mail/lib/lang/hu_mail_user.lng
+++ b/interface/web/mail/lib/lang/hu_mail_user.lng
@@ -41,6 +41,8 @@ $wb['name_optional_txt'] = '(Opcionális)';
 $wb['autoresponder_active'] = 'Automatikus válasz engedélyezése';
 $wb['cc_txt'] = 'Másolat küldése';
 $wb['cc_error_isemail'] = 'The Send copy to field does not conatin a valid email address';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 $wb['domain_txt'] = 'Domain';
 $wb['now_txt'] = 'Now';
 $wb['login_error_unique'] = 'Login is already taken.';
diff --git a/interface/web/mail/lib/lang/id_mail_user.lng b/interface/web/mail/lib/lang/id_mail_user.lng
index e4daf311f334f71992a3d9a3d2040c1197c1c61b..9abd07d28bc06d6de438c4579c42a9330cca1598 100644
--- a/interface/web/mail/lib/lang/id_mail_user.lng
+++ b/interface/web/mail/lib/lang/id_mail_user.lng
@@ -41,6 +41,8 @@ $wb['name_optional_txt'] = '(Opsional)';
 $wb['autoresponder_active'] = 'Aktifkan Penjawab Otomatis';
 $wb['cc_txt'] = 'Kirim salinan ke';
 $wb['cc_error_isemail'] = 'Kolom Kirim salinan ke tidak berisi alamat email yang valid';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 $wb['domain_txt'] = 'Domain';
 $wb['now_txt'] = 'Now';
 $wb['login_error_unique'] = 'Login is already taken.';
diff --git a/interface/web/mail/lib/lang/it_mail_user.lng b/interface/web/mail/lib/lang/it_mail_user.lng
index 34b523f5519cc5f2dd6222d9be95123ed0513fb0..0b38c32fcb74388e1ac2b8062072905d68df5b39 100644
--- a/interface/web/mail/lib/lang/it_mail_user.lng
+++ b/interface/web/mail/lib/lang/it_mail_user.lng
@@ -40,6 +40,8 @@ $wb['name_optional_txt'] = '(Opzionale)';
 $wb['autoresponder_active'] = 'Abilita autorisponditore';
 $wb['cc_txt'] = 'Trasmetti copia a';
 $wb['cc_error_isemail'] = 'Il campo trasmetti copia a non contiene un indirizzo email valido';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 $wb['domain_txt'] = 'Dominio';
 $wb['now_txt'] = 'Ora';
 $wb['login_error_unique'] = 'Questo Login è già occupato.';
diff --git a/interface/web/mail/lib/lang/ja_mail_user.lng b/interface/web/mail/lib/lang/ja_mail_user.lng
index 7b6b48dca49915804de56b50f85551a43d09a65d..bb89671d9cad68695e9f2e044c8ddb8a73529a86 100644
--- a/interface/web/mail/lib/lang/ja_mail_user.lng
+++ b/interface/web/mail/lib/lang/ja_mail_user.lng
@@ -41,6 +41,8 @@ $wb['name_optional_txt'] = '(Optional)';
 $wb['autoresponder_active'] = 'Enable the autoresponder';
 $wb['cc_txt'] = 'Send copy to';
 $wb['cc_error_isemail'] = 'The Send copy to field does not conatin a valid email address';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 $wb['domain_txt'] = 'Domain';
 $wb['now_txt'] = 'Now';
 $wb['login_error_unique'] = 'Login is already taken.';
diff --git a/interface/web/mail/lib/lang/nl_mail_user.lng b/interface/web/mail/lib/lang/nl_mail_user.lng
index 83002f79aaef705f59ffdc9b0c210799339d451a..9e35762618677bae6ba1be2f7538da0488b7557b 100644
--- a/interface/web/mail/lib/lang/nl_mail_user.lng
+++ b/interface/web/mail/lib/lang/nl_mail_user.lng
@@ -40,6 +40,8 @@ $wb['name_optional_txt'] = '(Optioneel)';
 $wb['autoresponder_active'] = 'Inschakelen autobeantwoorden';
 $wb['cc_txt'] = 'Stuur kopie naar';
 $wb['cc_error_isemail'] = 'Het \\"Stuur kopie naar\\" veld bevat geen geldig e-mail adres';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 $wb['domain_txt'] = 'Domain';
 $wb['now_txt'] = 'Nu';
 $wb['login_error_unique'] = 'Login is already taken.';
diff --git a/interface/web/mail/lib/lang/pl_mail_user.lng b/interface/web/mail/lib/lang/pl_mail_user.lng
index 15ddeca66f883c3d5a8ab11ef518e24cbf199947..44462af34cca69012daaf3a74fde6e0ad8c9529b 100644
--- a/interface/web/mail/lib/lang/pl_mail_user.lng
+++ b/interface/web/mail/lib/lang/pl_mail_user.lng
@@ -41,6 +41,8 @@ $wb['name_optional_txt'] = '(Opcjonalnie)';
 $wb['autoresponder_active'] = 'Uruchom autorespondera';
 $wb['cc_txt'] = 'Wyślij kopię do';
 $wb['cc_error_isemail'] = 'Pole wysyłania kopii nie zawiera poprawnego adresu e-mail';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 $wb['domain_txt'] = 'Domena';
 $wb['now_txt'] = 'Teraz';
 $wb['login_error_unique'] = 'Login jest już w użyciu.';
diff --git a/interface/web/mail/lib/lang/pt_mail_user.lng b/interface/web/mail/lib/lang/pt_mail_user.lng
index 9f6227e268ccd7031d32304aecab61c6e134b16f..e197f448c6fdc92a82cead3b0405f580205dee2c 100644
--- a/interface/web/mail/lib/lang/pt_mail_user.lng
+++ b/interface/web/mail/lib/lang/pt_mail_user.lng
@@ -41,6 +41,8 @@ $wb['name_optional_txt'] = '(Optional)';
 $wb['autoresponder_active'] = 'Enable the autoresponder';
 $wb['cc_txt'] = 'Send copy to';
 $wb['cc_error_isemail'] = 'The Send copy to field does not conatin a valid email address';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 $wb['domain_txt'] = 'Domain';
 $wb['now_txt'] = 'Now';
 $wb['login_error_unique'] = 'Login is already taken.';
diff --git a/interface/web/mail/lib/lang/ro_mail_user.lng b/interface/web/mail/lib/lang/ro_mail_user.lng
index b358960525f11a11af19a916c605706c90a08205..85167e6b7ceccfb7040d9c3d9fbb5e2d6a7a06e7 100644
--- a/interface/web/mail/lib/lang/ro_mail_user.lng
+++ b/interface/web/mail/lib/lang/ro_mail_user.lng
@@ -41,6 +41,8 @@ $wb['name_optional_txt'] = '(Optional)';
 $wb['autoresponder_active'] = 'Enable the autoresponder';
 $wb['cc_txt'] = 'Send copy to';
 $wb['cc_error_isemail'] = 'The Send copy to field does not conatin a valid email address';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 $wb['domain_txt'] = 'Domain';
 $wb['now_txt'] = 'Now';
 $wb['login_error_unique'] = 'Login is already taken.';
diff --git a/interface/web/mail/lib/lang/ru_mail_user.lng b/interface/web/mail/lib/lang/ru_mail_user.lng
index a6f8a9fb7e9fb2bdf5afacc03682201d5ffd1be6..4fb2147ddb6b71a4927bada4998226d78d49e8a3 100644
--- a/interface/web/mail/lib/lang/ru_mail_user.lng
+++ b/interface/web/mail/lib/lang/ru_mail_user.lng
@@ -41,6 +41,8 @@ $wb['name_optional_txt'] = '(Опционально)';
 $wb['autoresponder_active'] = 'Включить автоответчик';
 $wb['cc_txt'] = 'Отправить копию';
 $wb['cc_error_isemail'] = 'Поле -Отправить копию- не содержит действительный адрес электронной почты';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 $wb['domain_txt'] = 'Домен';
 $wb['now_txt'] = 'Сейчас';
 $wb['login_error_unique'] = 'Логин уже занят.';
diff --git a/interface/web/mail/lib/lang/se_mail_user.lng b/interface/web/mail/lib/lang/se_mail_user.lng
index f528bb3ef4659c4b8be6028af6f5f9d8e7c678f5..270d3de346913acf3f9de163a2347c117f0b87f1 100644
--- a/interface/web/mail/lib/lang/se_mail_user.lng
+++ b/interface/web/mail/lib/lang/se_mail_user.lng
@@ -41,6 +41,8 @@ $wb['name_optional_txt'] = '(Frivilligt)';
 $wb['autoresponder_active'] = 'Aktivera autosvaret';
 $wb['cc_txt'] = 'Skicka kopia till';
 $wb['cc_error_isemail'] = 'The Send copy to field does not conatin a valid email address';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 $wb['domain_txt'] = 'Domän';
 $wb['now_txt'] = 'Nu';
 $wb['login_error_unique'] = 'Login is already taken.';
diff --git a/interface/web/mail/lib/lang/sk_mail_user.lng b/interface/web/mail/lib/lang/sk_mail_user.lng
index 207be539474755db980d61a9cce7b09d6ccb604a..d12e8abe02fc973990014bae8729e1742362546c 100644
--- a/interface/web/mail/lib/lang/sk_mail_user.lng
+++ b/interface/web/mail/lib/lang/sk_mail_user.lng
@@ -41,6 +41,8 @@ $wb['name_optional_txt'] = '(Optional)';
 $wb['autoresponder_active'] = 'Enable the autoresponder';
 $wb['cc_txt'] = 'Send copy to';
 $wb['cc_error_isemail'] = 'The Send copy to field does not conatin a valid email address';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 $wb['domain_txt'] = 'Domain';
 $wb['now_txt'] = 'Now';
 $wb['login_error_unique'] = 'Login is already taken.';
diff --git a/interface/web/mail/lib/lang/tr_mail_user.lng b/interface/web/mail/lib/lang/tr_mail_user.lng
index 203338047a225c8e594cd4ff1bfd3397ebc6fa4b..3ea2afe6caece20f81c2f1a79e99816df877e636 100644
--- a/interface/web/mail/lib/lang/tr_mail_user.lng
+++ b/interface/web/mail/lib/lang/tr_mail_user.lng
@@ -46,8 +46,10 @@ $wb['name_txt'] = 'Ad';
 $wb['name_optional_txt'] = '(İsteğe bağlı)';
 $wb['autoresponder_active'] = 'Otoyanıtlayıcı kullanılsın';
 $wb['cc_txt'] = 'Kopyası şuraya gönderilsin';
-$wb['sender_cc_txt'] = 'Gidenin Gizli Kopyası Şuraya Gönderilsin';
 $wb['cc_error_isemail'] = 'Kopyası şuraya gönderilsin alanına geçerli bir e-posta adresi yazılmalı';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
+$wb['sender_cc_txt'] = 'Gidenin Gizli Kopyası Şuraya Gönderilsin';
 $wb['sender_cc_error_isemail'] = 'Gidenin gizli kopyası şuraya gönderilsin alanındaki e-posta adresi geçersiz';
 $wb['domain_txt'] = 'Etki Alanı';
 $wb['now_txt'] = 'Åžimdi';
diff --git a/interface/web/mail/templates/mail_user_mailbox_edit.htm b/interface/web/mail/templates/mail_user_mailbox_edit.htm
index c53bc8529241ea3b57b923f18936f3af26511c2e..f41851963b9ad9c06670b837b46784e7b5831bb2 100644
--- a/interface/web/mail/templates/mail_user_mailbox_edit.htm
+++ b/interface/web/mail/templates/mail_user_mailbox_edit.htm
@@ -54,6 +54,12 @@
                 <label for="name" class="col-sm-3 control-label">{tmpl_var name='cc_txt'}</label>
                 <div class="col-sm-6"><input type="text" name="cc" id="cc" value="{tmpl_var name='cc'}" class="form-control" /></div><div class="col-sm-3 input-sm"> &nbsp; {tmpl_var name='name_optional_txt'} {tmpl_var name='cc_note_txt'}
             </div></div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">{tmpl_var name='forward_in_lda_txt'}</label>
+                <div class="col-sm-9">
+                    <a href="#" data-toggle="tooltip" title="{tmpl_var name='tooltip_forward_in_lda_txt'}">{tmpl_var name='forward_in_lda'}</a>
+                </div>
+            </div>
             <div class="form-group">
                 <label for="sender_name" class="col-sm-3 control-label">{tmpl_var name='sender_cc_txt'}</label>
                 <div class="col-sm-6"><input type="text" name="sender_cc" id="sender_cc" value="{tmpl_var name='sender_cc'}" class="form-control" /></div><div class="col-sm-3 input-sm"> &nbsp; {tmpl_var name='name_optional_txt'} {tmpl_var name='sender_cc_note_txt'}
diff --git a/interface/web/mailuser/form/mail_user_cc.tform.php b/interface/web/mailuser/form/mail_user_cc.tform.php
index 5f5e13a9d8df5e599854b2f38665b690e665b4a7..fb26892584ce1970a7844b3f079d6f26bf3c1558 100644
--- a/interface/web/mailuser/form/mail_user_cc.tform.php
+++ b/interface/web/mailuser/form/mail_user_cc.tform.php
@@ -76,7 +76,13 @@ $form["tabs"]['mailuser'] = array (
 			'default' => '',
 			'value'  => '',
 			'width'  => '30',
-			'maxlength' => '255'
+			'maxlength' => '65535'
+		),
+		'forward_in_lda' => array (
+			'datatype' => 'VARCHAR',
+			'formtype' => 'CHECKBOX',
+			'default' => 'n',
+			'value'  => array(0 => 'n', 1 => 'y')
 		),
 		//#################################
 		// END Datatable fields
diff --git a/interface/web/mailuser/lib/lang/ar_mail_user_cc.lng b/interface/web/mailuser/lib/lang/ar_mail_user_cc.lng
index 81877884cce3a2bda6651068a61e473fad2882ce..4e7ef766e750f86f2bbecc1b29ad038bbba2ca46 100644
--- a/interface/web/mailuser/lib/lang/ar_mail_user_cc.lng
+++ b/interface/web/mailuser/lib/lang/ar_mail_user_cc.lng
@@ -6,4 +6,6 @@ $wb['cc_error_isemail'] = 'Email address invalid in -Send copy to- field';
 $wb['email_is_cc_error'] = 'Email address and send copy to address can not be the same.';
 $wb['name_optional_txt'] = '(Optional)';
 $wb['cc_note_txt'] = '(Separate multiple email addresses with commas)';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 ?>
diff --git a/interface/web/mailuser/lib/lang/bg_mail_user_cc.lng b/interface/web/mailuser/lib/lang/bg_mail_user_cc.lng
index 81877884cce3a2bda6651068a61e473fad2882ce..4e7ef766e750f86f2bbecc1b29ad038bbba2ca46 100644
--- a/interface/web/mailuser/lib/lang/bg_mail_user_cc.lng
+++ b/interface/web/mailuser/lib/lang/bg_mail_user_cc.lng
@@ -6,4 +6,6 @@ $wb['cc_error_isemail'] = 'Email address invalid in -Send copy to- field';
 $wb['email_is_cc_error'] = 'Email address and send copy to address can not be the same.';
 $wb['name_optional_txt'] = '(Optional)';
 $wb['cc_note_txt'] = '(Separate multiple email addresses with commas)';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 ?>
diff --git a/interface/web/mailuser/lib/lang/br_mail_user_cc.lng b/interface/web/mailuser/lib/lang/br_mail_user_cc.lng
index 7a1e9a3d95a91ecea9173c8b7104cfc9cf8b2f19..8008ed26185aebd7eaa4fe7dfaab8c5fde0d7065 100644
--- a/interface/web/mailuser/lib/lang/br_mail_user_cc.lng
+++ b/interface/web/mailuser/lib/lang/br_mail_user_cc.lng
@@ -6,4 +6,6 @@ $wb['cc_error_isemail'] = 'Endereço de e-mail inválido no campo "Enviar cópia
 $wb['email_is_cc_error'] = 'Endereço de e-mail e "Enviar cópia para" não podem ser os mesmos.';
 $wb['name_optional_txt'] = '(Opcional)';
 $wb['cc_note_txt'] = '(separar múltiplos endereços de e-mail com vírgulas)';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 ?>
diff --git a/interface/web/mailuser/lib/lang/ca_mail_user_cc.lng b/interface/web/mailuser/lib/lang/ca_mail_user_cc.lng
index 90cc6622de0ca180fcc3fdf20c7842855db5b0fd..15c4c34307a6cf2e2e6dcdb93fc6d82c3a2f5fd1 100644
--- a/interface/web/mailuser/lib/lang/ca_mail_user_cc.lng
+++ b/interface/web/mailuser/lib/lang/ca_mail_user_cc.lng
@@ -6,4 +6,6 @@ $wb['cc_error_isemail'] = 'Courriel invalide dans le champ - copie conforme -';
 $wb['email_is_cc_error'] = 'Coipe conforme invalide.';
 $wb['name_optional_txt'] = '(Optionnel)';
 $wb['cc_note_txt'] = '(Séparer chaque adresses par une virgule)';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 ?>
diff --git a/interface/web/mailuser/lib/lang/cz_mail_user_cc.lng b/interface/web/mailuser/lib/lang/cz_mail_user_cc.lng
index 57ecd90b9a0887f4d07530ab3e9fb77c05eecd56..1f94bd024da306d97357a29f3bec78a1ff88d206 100644
--- a/interface/web/mailuser/lib/lang/cz_mail_user_cc.lng
+++ b/interface/web/mailuser/lib/lang/cz_mail_user_cc.lng
@@ -6,4 +6,6 @@ $wb['cc_error_isemail'] = 'Vyplněná e-mailová adresa neplatná';
 $wb['email_is_cc_error'] = 'Vyplněná e-mailová adresa a poslat kopii na e-mail adresu, nemůžou být stejné.';
 $wb['name_optional_txt'] = '(Volitelné)';
 $wb['cc_note_txt'] = '(Při posílání kopií na více e-mailových adres, oddělte čárkami.)';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 ?>
diff --git a/interface/web/mailuser/lib/lang/de_mail_user_cc.lng b/interface/web/mailuser/lib/lang/de_mail_user_cc.lng
index e43d39c1697bb0e67578a3c634048db25cc3831a..6810752d4d68c78ea1bd0e6a3c0b6f9a953bae86 100644
--- a/interface/web/mailuser/lib/lang/de_mail_user_cc.lng
+++ b/interface/web/mailuser/lib/lang/de_mail_user_cc.lng
@@ -6,4 +6,6 @@ $wb['cc_error_isemail'] = 'E-Mail Adresse ungültig im -Kopie senden an- Feld';
 $wb['email_is_cc_error'] = 'E-Mail Adresse und ';
 $wb['name_optional_txt'] = '(optional)';
 $wb['cc_note_txt'] = '(Mehrere E-Mail-Adressen mit Kommas trennen)';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 ?>
diff --git a/interface/web/mailuser/lib/lang/dk_mail_user_cc.lng b/interface/web/mailuser/lib/lang/dk_mail_user_cc.lng
index 8fafd94e5a5f36081622b78a1263f1f6efb9a691..70052fdaeb894a03e41b26e608b1e603c9e5ce5a 100644
--- a/interface/web/mailuser/lib/lang/dk_mail_user_cc.lng
+++ b/interface/web/mailuser/lib/lang/dk_mail_user_cc.lng
@@ -6,4 +6,6 @@ $wb['cc_error_isemail'] = 'E-mail adresse ugyldig i -Send kopi til- feltet';
 $wb['email_is_cc_error'] = 'E-mail adresse og send kopi til adressen kan ikke være det samme.';
 $wb['name_optional_txt'] = '(Valgfri)';
 $wb['cc_note_txt'] = '(Adskil flere e-mail adresser med kommaer)';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 ?>
diff --git a/interface/web/mailuser/lib/lang/el_mail_user_cc.lng b/interface/web/mailuser/lib/lang/el_mail_user_cc.lng
index 81877884cce3a2bda6651068a61e473fad2882ce..4e7ef766e750f86f2bbecc1b29ad038bbba2ca46 100644
--- a/interface/web/mailuser/lib/lang/el_mail_user_cc.lng
+++ b/interface/web/mailuser/lib/lang/el_mail_user_cc.lng
@@ -6,4 +6,6 @@ $wb['cc_error_isemail'] = 'Email address invalid in -Send copy to- field';
 $wb['email_is_cc_error'] = 'Email address and send copy to address can not be the same.';
 $wb['name_optional_txt'] = '(Optional)';
 $wb['cc_note_txt'] = '(Separate multiple email addresses with commas)';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 ?>
diff --git a/interface/web/mailuser/lib/lang/en_mail_user_cc.lng b/interface/web/mailuser/lib/lang/en_mail_user_cc.lng
index 3437d50d195c8bdef543e2a688f5527250585415..b9c1a20caca304589a8f23bd50027a4555808555 100644
--- a/interface/web/mailuser/lib/lang/en_mail_user_cc.lng
+++ b/interface/web/mailuser/lib/lang/en_mail_user_cc.lng
@@ -6,4 +6,6 @@ $wb["cc_error_isemail"] = 'Email address invalid in -Send copy to- field';
 $wb["email_is_cc_error"] = 'Email address and send copy to address can not be the same.';
 $wb["name_optional_txt"] = '(Optional)';
 $wb['cc_note_txt'] = '(Separate multiple email addresses with commas)';
-?>
\ No newline at end of file
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
+?>
diff --git a/interface/web/mailuser/lib/lang/es_mail_user_cc.lng b/interface/web/mailuser/lib/lang/es_mail_user_cc.lng
index aef29a0cdbea2aeae1709bd01c8a292257398846..5b1c05a2aafcc62e87a6fac15eb4dbeaba35c9cf 100644
--- a/interface/web/mailuser/lib/lang/es_mail_user_cc.lng
+++ b/interface/web/mailuser/lib/lang/es_mail_user_cc.lng
@@ -6,4 +6,6 @@ $wb['email_is_cc_error'] = 'La dirección de correo y enviar copia a, no pueden
 $wb['email_txt'] = 'Correo';
 $wb['mailbox_cc_txt'] = 'Enviar copia a direcciones de correo';
 $wb['name_optional_txt'] = '(Opcional)';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 ?>
diff --git a/interface/web/mailuser/lib/lang/fi_mail_user_cc.lng b/interface/web/mailuser/lib/lang/fi_mail_user_cc.lng
index 81877884cce3a2bda6651068a61e473fad2882ce..4e7ef766e750f86f2bbecc1b29ad038bbba2ca46 100644
--- a/interface/web/mailuser/lib/lang/fi_mail_user_cc.lng
+++ b/interface/web/mailuser/lib/lang/fi_mail_user_cc.lng
@@ -6,4 +6,6 @@ $wb['cc_error_isemail'] = 'Email address invalid in -Send copy to- field';
 $wb['email_is_cc_error'] = 'Email address and send copy to address can not be the same.';
 $wb['name_optional_txt'] = '(Optional)';
 $wb['cc_note_txt'] = '(Separate multiple email addresses with commas)';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 ?>
diff --git a/interface/web/mailuser/lib/lang/fr_mail_user_cc.lng b/interface/web/mailuser/lib/lang/fr_mail_user_cc.lng
index d29dacd8304b71ab4c6fa2281427e0e2c261a1da..a0139d0fec1a5b56a0d54a83ec01bd354afbcbb4 100644
--- a/interface/web/mailuser/lib/lang/fr_mail_user_cc.lng
+++ b/interface/web/mailuser/lib/lang/fr_mail_user_cc.lng
@@ -6,4 +6,6 @@ $wb['cc_error_isemail'] = 'Adresse e-mail invalide dans le champ - Envoyer une
 $wb['email_is_cc_error'] = 'L’adresse e-mail principale et l’addresse de copie ne peuvent pas être identiques.';
 $wb['name_optional_txt'] = '(Optionel)';
 $wb['cc_note_txt'] = '(Séparer les addresses e-mail multiples avec une virgule)';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 ?>
diff --git a/interface/web/mailuser/lib/lang/hr_mail_user_cc.lng b/interface/web/mailuser/lib/lang/hr_mail_user_cc.lng
index 81877884cce3a2bda6651068a61e473fad2882ce..4e7ef766e750f86f2bbecc1b29ad038bbba2ca46 100644
--- a/interface/web/mailuser/lib/lang/hr_mail_user_cc.lng
+++ b/interface/web/mailuser/lib/lang/hr_mail_user_cc.lng
@@ -6,4 +6,6 @@ $wb['cc_error_isemail'] = 'Email address invalid in -Send copy to- field';
 $wb['email_is_cc_error'] = 'Email address and send copy to address can not be the same.';
 $wb['name_optional_txt'] = '(Optional)';
 $wb['cc_note_txt'] = '(Separate multiple email addresses with commas)';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 ?>
diff --git a/interface/web/mailuser/lib/lang/hu_mail_user_cc.lng b/interface/web/mailuser/lib/lang/hu_mail_user_cc.lng
index 81877884cce3a2bda6651068a61e473fad2882ce..4e7ef766e750f86f2bbecc1b29ad038bbba2ca46 100644
--- a/interface/web/mailuser/lib/lang/hu_mail_user_cc.lng
+++ b/interface/web/mailuser/lib/lang/hu_mail_user_cc.lng
@@ -6,4 +6,6 @@ $wb['cc_error_isemail'] = 'Email address invalid in -Send copy to- field';
 $wb['email_is_cc_error'] = 'Email address and send copy to address can not be the same.';
 $wb['name_optional_txt'] = '(Optional)';
 $wb['cc_note_txt'] = '(Separate multiple email addresses with commas)';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 ?>
diff --git a/interface/web/mailuser/lib/lang/id_mail_user_cc.lng b/interface/web/mailuser/lib/lang/id_mail_user_cc.lng
index 81877884cce3a2bda6651068a61e473fad2882ce..4e7ef766e750f86f2bbecc1b29ad038bbba2ca46 100644
--- a/interface/web/mailuser/lib/lang/id_mail_user_cc.lng
+++ b/interface/web/mailuser/lib/lang/id_mail_user_cc.lng
@@ -6,4 +6,6 @@ $wb['cc_error_isemail'] = 'Email address invalid in -Send copy to- field';
 $wb['email_is_cc_error'] = 'Email address and send copy to address can not be the same.';
 $wb['name_optional_txt'] = '(Optional)';
 $wb['cc_note_txt'] = '(Separate multiple email addresses with commas)';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 ?>
diff --git a/interface/web/mailuser/lib/lang/it_mail_user_cc.lng b/interface/web/mailuser/lib/lang/it_mail_user_cc.lng
index 01f22f5fc856ca905f89ad73304796b5d8225639..6ed79429fb8ee19c43a3029dfe3bca0c4d92e265 100644
--- a/interface/web/mailuser/lib/lang/it_mail_user_cc.lng
+++ b/interface/web/mailuser/lib/lang/it_mail_user_cc.lng
@@ -6,4 +6,6 @@ $wb['cc_error_isemail'] = 'Email address invalid in -Send copy to- field';
 $wb['email_is_cc_error'] = 'Email address and send copy to address can not be the same.';
 $wb['name_optional_txt'] = '(Optional)';
 $wb['cc_note_txt'] = '(Separate multiple email addresses with commas)';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 ?>
diff --git a/interface/web/mailuser/lib/lang/ja_mail_user_cc.lng b/interface/web/mailuser/lib/lang/ja_mail_user_cc.lng
index 81877884cce3a2bda6651068a61e473fad2882ce..4e7ef766e750f86f2bbecc1b29ad038bbba2ca46 100644
--- a/interface/web/mailuser/lib/lang/ja_mail_user_cc.lng
+++ b/interface/web/mailuser/lib/lang/ja_mail_user_cc.lng
@@ -6,4 +6,6 @@ $wb['cc_error_isemail'] = 'Email address invalid in -Send copy to- field';
 $wb['email_is_cc_error'] = 'Email address and send copy to address can not be the same.';
 $wb['name_optional_txt'] = '(Optional)';
 $wb['cc_note_txt'] = '(Separate multiple email addresses with commas)';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 ?>
diff --git a/interface/web/mailuser/lib/lang/nl_mail_user_cc.lng b/interface/web/mailuser/lib/lang/nl_mail_user_cc.lng
index 81877884cce3a2bda6651068a61e473fad2882ce..4e7ef766e750f86f2bbecc1b29ad038bbba2ca46 100644
--- a/interface/web/mailuser/lib/lang/nl_mail_user_cc.lng
+++ b/interface/web/mailuser/lib/lang/nl_mail_user_cc.lng
@@ -6,4 +6,6 @@ $wb['cc_error_isemail'] = 'Email address invalid in -Send copy to- field';
 $wb['email_is_cc_error'] = 'Email address and send copy to address can not be the same.';
 $wb['name_optional_txt'] = '(Optional)';
 $wb['cc_note_txt'] = '(Separate multiple email addresses with commas)';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 ?>
diff --git a/interface/web/mailuser/lib/lang/pl_mail_user_cc.lng b/interface/web/mailuser/lib/lang/pl_mail_user_cc.lng
index b9a63d8d085e2ce396226671573ddc6431eb41f3..1ec4648925adee8e021f754d5538c8b6ce4f1aea 100644
--- a/interface/web/mailuser/lib/lang/pl_mail_user_cc.lng
+++ b/interface/web/mailuser/lib/lang/pl_mail_user_cc.lng
@@ -6,4 +6,6 @@ $wb['cc_error_isemail'] = 'Adres e-mail jest niepoprawny w polu -Wyślij kopię
 $wb['email_is_cc_error'] = 'Adres e-mail i adres do wysyłki kopii nie mogą być takie same.';
 $wb['name_optional_txt'] = '(Optional)';
 $wb['cc_note_txt'] = '(Separate multiple email addresses with commas)';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 ?>
diff --git a/interface/web/mailuser/lib/lang/pt_mail_user_cc.lng b/interface/web/mailuser/lib/lang/pt_mail_user_cc.lng
index 81877884cce3a2bda6651068a61e473fad2882ce..4e7ef766e750f86f2bbecc1b29ad038bbba2ca46 100644
--- a/interface/web/mailuser/lib/lang/pt_mail_user_cc.lng
+++ b/interface/web/mailuser/lib/lang/pt_mail_user_cc.lng
@@ -6,4 +6,6 @@ $wb['cc_error_isemail'] = 'Email address invalid in -Send copy to- field';
 $wb['email_is_cc_error'] = 'Email address and send copy to address can not be the same.';
 $wb['name_optional_txt'] = '(Optional)';
 $wb['cc_note_txt'] = '(Separate multiple email addresses with commas)';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 ?>
diff --git a/interface/web/mailuser/lib/lang/ro_mail_user_cc.lng b/interface/web/mailuser/lib/lang/ro_mail_user_cc.lng
index 81877884cce3a2bda6651068a61e473fad2882ce..4e7ef766e750f86f2bbecc1b29ad038bbba2ca46 100644
--- a/interface/web/mailuser/lib/lang/ro_mail_user_cc.lng
+++ b/interface/web/mailuser/lib/lang/ro_mail_user_cc.lng
@@ -6,4 +6,6 @@ $wb['cc_error_isemail'] = 'Email address invalid in -Send copy to- field';
 $wb['email_is_cc_error'] = 'Email address and send copy to address can not be the same.';
 $wb['name_optional_txt'] = '(Optional)';
 $wb['cc_note_txt'] = '(Separate multiple email addresses with commas)';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 ?>
diff --git a/interface/web/mailuser/lib/lang/ru_mail_user_cc.lng b/interface/web/mailuser/lib/lang/ru_mail_user_cc.lng
index 7987b0106b3ea2aa95f2a66413d873159a53aa1e..f551318c0b39c313f4ea9a972bfa06aa0aacc9bb 100644
--- a/interface/web/mailuser/lib/lang/ru_mail_user_cc.lng
+++ b/interface/web/mailuser/lib/lang/ru_mail_user_cc.lng
@@ -6,4 +6,6 @@ $wb['cc_error_isemail'] = 'Поле -Отправить копию- не сод
 $wb['email_is_cc_error'] = 'Адрес электронной почты и адрес для отправки копии не могут быть одинаковыми.';
 $wb['name_optional_txt'] = '(Опционально)';
 $wb['cc_note_txt'] = '(Разделите несколько адресов электронной почты запятыми)';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 ?>
diff --git a/interface/web/mailuser/lib/lang/se_mail_user_cc.lng b/interface/web/mailuser/lib/lang/se_mail_user_cc.lng
index b01ae1b1ab15a806c91a7a5a37a04a137a479668..4894ee856cbc2c182010c33c0f12ecc9d07acf59 100644
--- a/interface/web/mailuser/lib/lang/se_mail_user_cc.lng
+++ b/interface/web/mailuser/lib/lang/se_mail_user_cc.lng
@@ -6,4 +6,6 @@ $wb['cc_error_isemail'] = 'Epostadressen i  -Skicka kopia till-fältet är ogilt
 $wb['email_is_cc_error'] = 'Epostadress och -Skicka kopia till- kan inte vara samma adress.';
 $wb['name_optional_txt'] = '(Frivilligt)';
 $wb['cc_note_txt'] = '(Separera flera epostadresser med kommatecken)';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 ?>
diff --git a/interface/web/mailuser/lib/lang/sk_mail_user_cc.lng b/interface/web/mailuser/lib/lang/sk_mail_user_cc.lng
index 81877884cce3a2bda6651068a61e473fad2882ce..4e7ef766e750f86f2bbecc1b29ad038bbba2ca46 100644
--- a/interface/web/mailuser/lib/lang/sk_mail_user_cc.lng
+++ b/interface/web/mailuser/lib/lang/sk_mail_user_cc.lng
@@ -6,4 +6,6 @@ $wb['cc_error_isemail'] = 'Email address invalid in -Send copy to- field';
 $wb['email_is_cc_error'] = 'Email address and send copy to address can not be the same.';
 $wb['name_optional_txt'] = '(Optional)';
 $wb['cc_note_txt'] = '(Separate multiple email addresses with commas)';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 ?>
diff --git a/interface/web/mailuser/lib/lang/tr_mail_user_cc.lng b/interface/web/mailuser/lib/lang/tr_mail_user_cc.lng
index 039ed7062500d7d69d127dd2148f0fa26191986d..978779767cea55d0a376232cc0b7e0bba9db1ca9 100644
--- a/interface/web/mailuser/lib/lang/tr_mail_user_cc.lng
+++ b/interface/web/mailuser/lib/lang/tr_mail_user_cc.lng
@@ -6,4 +6,6 @@ $wb['cc_error_isemail'] = '-Şuraya kopya gönder- e-posta adresi geçersiz';
 $wb['email_is_cc_error'] = 'E-posta adresi ile kopyanın gönderileceği adres aynı olamaz.';
 $wb['name_optional_txt'] = '(İsteğe bağlı)';
 $wb['cc_note_txt'] = '(Birden çok e-posta adresini virgül ile ayırarak yazın)';
+$wb['forward_in_lda_txt'] = 'Copy during delivery';
+$wb['tooltip_forward_in_lda_txt'] = 'Controls if mail copy is forwarded before or during delivery to mailbox.';
 ?>
diff --git a/interface/web/mailuser/templates/mail_user_cc_edit.htm b/interface/web/mailuser/templates/mail_user_cc_edit.htm
index 914f74ae3fe304f71219c823401d3b2ddde44a49..7bf44e4cadadaca4e6b8edd1751c9b0118e5282b 100644
--- a/interface/web/mailuser/templates/mail_user_cc_edit.htm
+++ b/interface/web/mailuser/templates/mail_user_cc_edit.htm
@@ -1,12 +1,17 @@
-            <div class="form-group">
-                <label class="col-sm-3 control-label">{tmpl_var name='email_txt'}</label>
-                <div class="col-sm-9"><div class="checkbox">{tmpl_var name='email'}</div></div>
+        <div class="form-group">
+            <label class="col-sm-3 control-label">{tmpl_var name='email_txt'}</label>
+            <div class="col-sm-9"><div class="checkbox">{tmpl_var name='email'}</div></div>
+        </div>
+        <div class="form-group">
+            <label for="name" class="col-sm-3 control-label">{tmpl_var name='cc_txt'}</label>
+            <div class="col-sm-6"><input type="text" name="cc" id="cc" value="{tmpl_var name='cc'}" class="form-control" /></div><div class="col-sm-3 input-sm"> &nbsp; {tmpl_var name='name_optional_txt'} {tmpl_var name='cc_note_txt'}
+        </div></div>
+        <div class="form-group">
+            <label class="col-sm-3 control-label">{tmpl_var name='forward_in_lda_txt'}</label>
+            <div class="col-sm-9">
+                <a href="#" data-toggle="tooltip" title="{tmpl_var name='tooltip_forward_in_lda_txt'}">{tmpl_var name='forward_in_lda'}</a>
             </div>
-            <div class="form-group">
-                <label for="name" class="col-sm-3 control-label">{tmpl_var name='cc_txt'}</label>
-                <div class="col-sm-6"><input type="text" name="cc" id="cc" value="{tmpl_var name='cc'}" class="form-control" /></div><div class="col-sm-3 input-sm"> &nbsp; {tmpl_var name='name_optional_txt'} {tmpl_var name='cc_note_txt'}
-            </div></div>
-        
+        </div>
 
         <input type="hidden" name="id" value="{tmpl_var name='id'}">
 
diff --git a/interface/web/sites/lib/lang/ar_web_vhost_domain.lng b/interface/web/sites/lib/lang/ar_web_vhost_domain.lng
index 93bc26badc5f476a52077ee2d0cb2d69655ceac5..bed4b80e07da4333ff0be5aeb426ff4561eea141 100644
--- a/interface/web/sites/lib/lang/ar_web_vhost_domain.lng
+++ b/interface/web/sites/lib/lang/ar_web_vhost_domain.lng
@@ -181,6 +181,7 @@ $wb["backup_format_tar_7z_lzma_txt"] = 'tar + 7z (LZMA)';
 $wb["backup_format_tar_7z_lzma2_txt"] = 'tar + 7z (LZMA2)';
 $wb["backup_format_tar_7z_ppmd_txt"] = 'tar + 7z (PPMd)';
 $wb["backup_format_tar_7z_bzip2_txt"] = 'tar + 7z (BZip2)';
+$wb['dependent_domains_txt'] = 'Dependent sub- / aliasdomains';
 $wb['error_ipv4_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv4 address.';
 $wb['error_ipv6_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv6 address.';
 $wb['error_domain_change_forbidden'] = 'The domain name cannot be changed. Please contact your administrator if you want to change the domain name.';
diff --git a/interface/web/sites/lib/lang/bg_web_vhost_domain.lng b/interface/web/sites/lib/lang/bg_web_vhost_domain.lng
index 384c6de545d0d47a459a98d99d433ed1212603e6..7e2c91f0c77e89b62f27bbeb9a3909e4776bc89a 100644
--- a/interface/web/sites/lib/lang/bg_web_vhost_domain.lng
+++ b/interface/web/sites/lib/lang/bg_web_vhost_domain.lng
@@ -181,6 +181,7 @@ $wb["backup_format_tar_7z_lzma_txt"] = 'tar + 7z (LZMA)';
 $wb["backup_format_tar_7z_lzma2_txt"] = 'tar + 7z (LZMA2)';
 $wb["backup_format_tar_7z_ppmd_txt"] = 'tar + 7z (PPMd)';
 $wb["backup_format_tar_7z_bzip2_txt"] = 'tar + 7z (BZip2)';
+$wb['dependent_domains_txt'] = 'Dependent sub- / aliasdomains';
 $wb['error_ipv4_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv4 address.';
 $wb['error_ipv6_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv6 address.';
 $wb['error_domain_change_forbidden'] = 'The domain name cannot be changed. Please contact your administrator if you want to change the domain name.';
diff --git a/interface/web/sites/lib/lang/br_web_vhost_domain.lng b/interface/web/sites/lib/lang/br_web_vhost_domain.lng
index acd10622fec1898e7bcedbe6d08506478406922f..c8eb7f6b822041c44b9dc80283a4accc23cb01cd 100644
--- a/interface/web/sites/lib/lang/br_web_vhost_domain.lng
+++ b/interface/web/sites/lib/lang/br_web_vhost_domain.lng
@@ -186,6 +186,7 @@ $wb["backup_format_tar_7z_lzma_txt"] = 'tar + 7z (LZMA)';
 $wb["backup_format_tar_7z_lzma2_txt"] = 'tar + 7z (LZMA2)';
 $wb["backup_format_tar_7z_ppmd_txt"] = 'tar + 7z (PPMd)';
 $wb["backup_format_tar_7z_bzip2_txt"] = 'tar + 7z (BZip2)';
+$wb['dependent_domains_txt'] = 'Dependent sub- / aliasdomains';
 $wb['error_ipv4_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv4 address.';
 $wb['error_ipv6_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv6 address.';
 $wb['error_domain_change_forbidden'] = 'The domain name cannot be changed. Please contact your administrator if you want to change the domain name.';
diff --git a/interface/web/sites/lib/lang/ca_web_vhost_domain.lng b/interface/web/sites/lib/lang/ca_web_vhost_domain.lng
index f1b755827dd49d9a42b6764fdf4b9ec2f5aff227..171a20b442664f6a92cdf4bd4bef6c2649e8aa1f 100644
--- a/interface/web/sites/lib/lang/ca_web_vhost_domain.lng
+++ b/interface/web/sites/lib/lang/ca_web_vhost_domain.lng
@@ -181,6 +181,7 @@ $wb["backup_format_tar_7z_lzma_txt"] = 'tar + 7z (LZMA)';
 $wb["backup_format_tar_7z_lzma2_txt"] = 'tar + 7z (LZMA2)';
 $wb["backup_format_tar_7z_ppmd_txt"] = 'tar + 7z (PPMd)';
 $wb["backup_format_tar_7z_bzip2_txt"] = 'tar + 7z (BZip2)';
+$wb['dependent_domains_txt'] = 'Dependent sub- / aliasdomains';
 $wb['error_ipv4_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv4 address.';
 $wb['error_ipv6_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv6 address.';
 $wb['error_domain_change_forbidden'] = 'The domain name cannot be changed. Please contact your administrator if you want to change the domain name.';
diff --git a/interface/web/sites/lib/lang/cz_web_vhost_domain.lng b/interface/web/sites/lib/lang/cz_web_vhost_domain.lng
index 88b3cb3e5a25343b608a1d6f270509dbef413753..dd62c738254d7b45e1aedc4922be0d301bd97288 100644
--- a/interface/web/sites/lib/lang/cz_web_vhost_domain.lng
+++ b/interface/web/sites/lib/lang/cz_web_vhost_domain.lng
@@ -181,6 +181,7 @@ $wb["backup_format_tar_7z_lzma_txt"] = 'tar + 7z (LZMA)';
 $wb["backup_format_tar_7z_lzma2_txt"] = 'tar + 7z (LZMA2)';
 $wb["backup_format_tar_7z_ppmd_txt"] = 'tar + 7z (PPMd)';
 $wb["backup_format_tar_7z_bzip2_txt"] = 'tar + 7z (BZip2)';
+$wb['dependent_domains_txt'] = 'Dependent sub- / aliasdomains';
 $wb['error_ipv4_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv4 address.';
 $wb['error_ipv6_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv6 address.';
 $wb['error_domain_change_forbidden'] = 'The domain name cannot be changed. Please contact your administrator if you want to change the domain name.';
diff --git a/interface/web/sites/lib/lang/de_web_vhost_domain.lng b/interface/web/sites/lib/lang/de_web_vhost_domain.lng
index 4fab6000843113b1d02396bc7d356bd98a0628a5..bb8682d2fed8f6d2c7d9529513a9a559b523c3dd 100644
--- a/interface/web/sites/lib/lang/de_web_vhost_domain.lng
+++ b/interface/web/sites/lib/lang/de_web_vhost_domain.lng
@@ -181,6 +181,7 @@ $wb["backup_format_tar_7z_lzma_txt"] = 'tar + 7z (LZMA)';
 $wb["backup_format_tar_7z_lzma2_txt"] = 'tar + 7z (LZMA2)';
 $wb["backup_format_tar_7z_ppmd_txt"] = 'tar + 7z (PPMd)';
 $wb["backup_format_tar_7z_bzip2_txt"] = 'tar + 7z (BZip2)';
+$wb['dependent_domains_txt'] = 'Dependent sub- / aliasdomains';
 $wb['error_ipv4_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv4 address.';
 $wb['error_ipv6_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv6 address.';
 $wb['error_domain_change_forbidden'] = 'The domain name cannot be changed. Please contact your administrator if you want to change the domain name.';
diff --git a/interface/web/sites/lib/lang/dk_web_vhost_domain.lng b/interface/web/sites/lib/lang/dk_web_vhost_domain.lng
index f1b755827dd49d9a42b6764fdf4b9ec2f5aff227..171a20b442664f6a92cdf4bd4bef6c2649e8aa1f 100644
--- a/interface/web/sites/lib/lang/dk_web_vhost_domain.lng
+++ b/interface/web/sites/lib/lang/dk_web_vhost_domain.lng
@@ -181,6 +181,7 @@ $wb["backup_format_tar_7z_lzma_txt"] = 'tar + 7z (LZMA)';
 $wb["backup_format_tar_7z_lzma2_txt"] = 'tar + 7z (LZMA2)';
 $wb["backup_format_tar_7z_ppmd_txt"] = 'tar + 7z (PPMd)';
 $wb["backup_format_tar_7z_bzip2_txt"] = 'tar + 7z (BZip2)';
+$wb['dependent_domains_txt'] = 'Dependent sub- / aliasdomains';
 $wb['error_ipv4_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv4 address.';
 $wb['error_ipv6_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv6 address.';
 $wb['error_domain_change_forbidden'] = 'The domain name cannot be changed. Please contact your administrator if you want to change the domain name.';
diff --git a/interface/web/sites/lib/lang/el_web_vhost_domain.lng b/interface/web/sites/lib/lang/el_web_vhost_domain.lng
index 15d51f3a5a0f3612399f2e300bdb71b9b2cd33b7..490b39aa02875a17a749254f4d8936989c5b7bf7 100644
--- a/interface/web/sites/lib/lang/el_web_vhost_domain.lng
+++ b/interface/web/sites/lib/lang/el_web_vhost_domain.lng
@@ -181,6 +181,7 @@ $wb["backup_format_tar_7z_lzma_txt"] = 'tar + 7z (LZMA)';
 $wb["backup_format_tar_7z_lzma2_txt"] = 'tar + 7z (LZMA2)';
 $wb["backup_format_tar_7z_ppmd_txt"] = 'tar + 7z (PPMd)';
 $wb["backup_format_tar_7z_bzip2_txt"] = 'tar + 7z (BZip2)';
+$wb['dependent_domains_txt'] = 'Dependent sub- / aliasdomains';
 $wb['error_ipv4_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv4 address.';
 $wb['error_ipv6_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv6 address.';
 $wb['error_domain_change_forbidden'] = 'The domain name cannot be changed. Please contact your administrator if you want to change the domain name.';
diff --git a/interface/web/sites/lib/lang/en_web_vhost_domain.lng b/interface/web/sites/lib/lang/en_web_vhost_domain.lng
index b31f157718fa70a5c0a3c780d4b4196036038057..d1b41819f7a2246949f3cb1ec7e1e1bd064963a3 100644
--- a/interface/web/sites/lib/lang/en_web_vhost_domain.lng
+++ b/interface/web/sites/lib/lang/en_web_vhost_domain.lng
@@ -158,6 +158,7 @@ $wb['https_port_error_regex'] = 'HTTPS Port invalid.';
 $wb['enable_pagespeed_txt'] = 'Enable PageSpeed';
 $wb['log_retention_txt'] = 'Logfiles retention time';
 $wb['log_retention_error_regex'] = 'Retention time in days (allowed values: min. 0 - max. 9999)';
+$wb['dependent_domains_txt'] = 'Dependent sub- / aliasdomains';
 $wb['limit_web_quota_not_0_txt'] = 'Harddisk Quota cannot be set to 0.';
 $wb['proxy_protocol_txt'] = 'Enable PROXY Protocol';
 $wb["backup_format_web_txt"] = 'Backup format for web files';
diff --git a/interface/web/sites/lib/lang/es_web_vhost_domain.lng b/interface/web/sites/lib/lang/es_web_vhost_domain.lng
index f49636a9ad8e53860e2fdd86bfcdc4154f40a42b..7fdb2efa8a9572fbcddc62b0ac3cbf17c956828c 100644
--- a/interface/web/sites/lib/lang/es_web_vhost_domain.lng
+++ b/interface/web/sites/lib/lang/es_web_vhost_domain.lng
@@ -181,6 +181,7 @@ $wb["backup_format_tar_7z_lzma_txt"] = 'tar + 7z (LZMA)';
 $wb["backup_format_tar_7z_lzma2_txt"] = 'tar + 7z (LZMA2)';
 $wb["backup_format_tar_7z_ppmd_txt"] = 'tar + 7z (PPMd)';
 $wb["backup_format_tar_7z_bzip2_txt"] = 'tar + 7z (BZip2)';
+$wb['dependent_domains_txt'] = 'Dependent sub- / aliasdomains';
 $wb['error_ipv4_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv4 address.';
 $wb['error_ipv6_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv6 address.';
 $wb['error_domain_change_forbidden'] = 'The domain name cannot be changed. Please contact your administrator if you want to change the domain name.';
diff --git a/interface/web/sites/lib/lang/fi_web_vhost_domain.lng b/interface/web/sites/lib/lang/fi_web_vhost_domain.lng
index e85b33e9cce39e7b201f58d49a51a88c7ae6cee9..f2f7d732d0cbab1a8d2a48752281269cd2ab95a8 100644
--- a/interface/web/sites/lib/lang/fi_web_vhost_domain.lng
+++ b/interface/web/sites/lib/lang/fi_web_vhost_domain.lng
@@ -181,6 +181,7 @@ $wb["backup_format_tar_7z_lzma_txt"] = 'tar + 7z (LZMA)';
 $wb["backup_format_tar_7z_lzma2_txt"] = 'tar + 7z (LZMA2)';
 $wb["backup_format_tar_7z_ppmd_txt"] = 'tar + 7z (PPMd)';
 $wb["backup_format_tar_7z_bzip2_txt"] = 'tar + 7z (BZip2)';
+$wb['dependent_domains_txt'] = 'Dependent sub- / aliasdomains';
 $wb['error_ipv4_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv4 address.';
 $wb['error_ipv6_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv6 address.';
 $wb['error_domain_change_forbidden'] = 'The domain name cannot be changed. Please contact your administrator if you want to change the domain name.';
diff --git a/interface/web/sites/lib/lang/fr_web_vhost_domain.lng b/interface/web/sites/lib/lang/fr_web_vhost_domain.lng
index 30963cd01c935e2ea7ac2d5b4d17519b62e4d0de..cfee4ef3fb40e2c4c7abf606545fee09f2122e52 100644
--- a/interface/web/sites/lib/lang/fr_web_vhost_domain.lng
+++ b/interface/web/sites/lib/lang/fr_web_vhost_domain.lng
@@ -181,6 +181,7 @@ $wb["backup_format_tar_7z_lzma_txt"] = 'tar + 7z (LZMA)';
 $wb["backup_format_tar_7z_lzma2_txt"] = 'tar + 7z (LZMA2)';
 $wb["backup_format_tar_7z_ppmd_txt"] = 'tar + 7z (PPMd)';
 $wb["backup_format_tar_7z_bzip2_txt"] = 'tar + 7z (BZip2)';
+$wb['dependent_domains_txt'] = 'Dependent sub- / aliasdomains';
 $wb['error_ipv4_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv4 address.';
 $wb['error_ipv6_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv6 address.';
 $wb['error_domain_change_forbidden'] = 'The domain name cannot be changed. Please contact your administrator if you want to change the domain name.';
diff --git a/interface/web/sites/lib/lang/hr_web_vhost_domain.lng b/interface/web/sites/lib/lang/hr_web_vhost_domain.lng
index 5ef073a0931ff40e965b75119710f0aa77d1d839..fe46d3d2e25da33950bdb8264fca9f29c2b896d9 100644
--- a/interface/web/sites/lib/lang/hr_web_vhost_domain.lng
+++ b/interface/web/sites/lib/lang/hr_web_vhost_domain.lng
@@ -181,6 +181,7 @@ $wb["backup_format_tar_7z_lzma_txt"] = 'tar + 7z (LZMA)';
 $wb["backup_format_tar_7z_lzma2_txt"] = 'tar + 7z (LZMA2)';
 $wb["backup_format_tar_7z_ppmd_txt"] = 'tar + 7z (PPMd)';
 $wb["backup_format_tar_7z_bzip2_txt"] = 'tar + 7z (BZip2)';
+$wb['dependent_domains_txt'] = 'Dependent sub- / aliasdomains';
 $wb['error_ipv4_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv4 address.';
 $wb['error_ipv6_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv6 address.';
 $wb['error_domain_change_forbidden'] = 'The domain name cannot be changed. Please contact your administrator if you want to change the domain name.';
diff --git a/interface/web/sites/lib/lang/hu_web_vhost_domain.lng b/interface/web/sites/lib/lang/hu_web_vhost_domain.lng
index 92f6a0d8b713a4f9978a1d33e33ecee7eef81a27..cceaa0d0051a653c1f3a213acd331b4e42abd137 100644
--- a/interface/web/sites/lib/lang/hu_web_vhost_domain.lng
+++ b/interface/web/sites/lib/lang/hu_web_vhost_domain.lng
@@ -181,6 +181,7 @@ $wb["backup_format_tar_7z_lzma_txt"] = 'tar + 7z (LZMA)';
 $wb["backup_format_tar_7z_lzma2_txt"] = 'tar + 7z (LZMA2)';
 $wb["backup_format_tar_7z_ppmd_txt"] = 'tar + 7z (PPMd)';
 $wb["backup_format_tar_7z_bzip2_txt"] = 'tar + 7z (BZip2)';
+$wb['dependent_domains_txt'] = 'Dependent sub- / aliasdomains';
 $wb['error_ipv4_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv4 address.';
 $wb['error_ipv6_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv6 address.';
 $wb['error_domain_change_forbidden'] = 'The domain name cannot be changed. Please contact your administrator if you want to change the domain name.';
diff --git a/interface/web/sites/lib/lang/id_web_vhost_domain.lng b/interface/web/sites/lib/lang/id_web_vhost_domain.lng
index 765081669f5f8f16cea630182d45caa43194a2f2..f0215d493220f6f9e65765683ed935131cc309e3 100644
--- a/interface/web/sites/lib/lang/id_web_vhost_domain.lng
+++ b/interface/web/sites/lib/lang/id_web_vhost_domain.lng
@@ -181,6 +181,7 @@ $wb["backup_format_tar_7z_lzma_txt"] = 'tar + 7z (LZMA)';
 $wb["backup_format_tar_7z_lzma2_txt"] = 'tar + 7z (LZMA2)';
 $wb["backup_format_tar_7z_ppmd_txt"] = 'tar + 7z (PPMd)';
 $wb["backup_format_tar_7z_bzip2_txt"] = 'tar + 7z (BZip2)';
+$wb['dependent_domains_txt'] = 'Dependent sub- / aliasdomains';
 $wb['error_ipv4_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv4 address.';
 $wb['error_ipv6_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv6 address.';
 $wb['error_domain_change_forbidden'] = 'The domain name cannot be changed. Please contact your administrator if you want to change the domain name.';
diff --git a/interface/web/sites/lib/lang/it_web_vhost_domain.lng b/interface/web/sites/lib/lang/it_web_vhost_domain.lng
index 40a2e5117b593af69a39c994c2e933345ea7e008..916f5d191ba3928690565e4a3cd52b1801d8fcee 100644
--- a/interface/web/sites/lib/lang/it_web_vhost_domain.lng
+++ b/interface/web/sites/lib/lang/it_web_vhost_domain.lng
@@ -181,6 +181,7 @@ $wb["backup_format_tar_7z_lzma_txt"] = 'tar + 7z (LZMA)';
 $wb["backup_format_tar_7z_lzma2_txt"] = 'tar + 7z (LZMA2)';
 $wb["backup_format_tar_7z_ppmd_txt"] = 'tar + 7z (PPMd)';
 $wb["backup_format_tar_7z_bzip2_txt"] = 'tar + 7z (BZip2)';
+$wb['dependent_domains_txt'] = 'Dependent sub- / aliasdomains';
 $wb['error_ipv4_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv4 address.';
 $wb['error_ipv6_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv6 address.';
 $wb['error_domain_change_forbidden'] = 'The domain name cannot be changed. Please contact your administrator if you want to change the domain name.';
diff --git a/interface/web/sites/lib/lang/ja_web_vhost_domain.lng b/interface/web/sites/lib/lang/ja_web_vhost_domain.lng
index fefa3b277ef7eb73bae4e9a5edf883c883460caa..2666f8bd4d30519635c9240272d8e78f9e85d607 100644
--- a/interface/web/sites/lib/lang/ja_web_vhost_domain.lng
+++ b/interface/web/sites/lib/lang/ja_web_vhost_domain.lng
@@ -181,6 +181,7 @@ $wb["backup_format_tar_7z_lzma_txt"] = 'tar + 7z (LZMA)';
 $wb["backup_format_tar_7z_lzma2_txt"] = 'tar + 7z (LZMA2)';
 $wb["backup_format_tar_7z_ppmd_txt"] = 'tar + 7z (PPMd)';
 $wb["backup_format_tar_7z_bzip2_txt"] = 'tar + 7z (BZip2)';
+$wb['dependent_domains_txt'] = 'Dependent sub- / aliasdomains';
 $wb['error_ipv4_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv4 address.';
 $wb['error_ipv6_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv6 address.';
 $wb['error_domain_change_forbidden'] = 'The domain name cannot be changed. Please contact your administrator if you want to change the domain name.';
diff --git a/interface/web/sites/lib/lang/nl_web_vhost_domain.lng b/interface/web/sites/lib/lang/nl_web_vhost_domain.lng
index 34f43d1e67a56cbf11c2cedaa04e071aedf64654..b28a56d2a540be6dee66fa01b31772214581997c 100644
--- a/interface/web/sites/lib/lang/nl_web_vhost_domain.lng
+++ b/interface/web/sites/lib/lang/nl_web_vhost_domain.lng
@@ -181,6 +181,7 @@ $wb["backup_format_tar_7z_lzma_txt"] = 'tar + 7z (LZMA)';
 $wb["backup_format_tar_7z_lzma2_txt"] = 'tar + 7z (LZMA2)';
 $wb["backup_format_tar_7z_ppmd_txt"] = 'tar + 7z (PPMd)';
 $wb["backup_format_tar_7z_bzip2_txt"] = 'tar + 7z (BZip2)';
+$wb['dependent_domains_txt'] = 'Dependent sub- / aliasdomains';
 $wb['error_ipv4_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv4 address.';
 $wb['error_ipv6_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv6 address.';
 $wb['error_domain_change_forbidden'] = 'The domain name cannot be changed. Please contact your administrator if you want to change the domain name.';
diff --git a/interface/web/sites/lib/lang/pl_web_vhost_domain.lng b/interface/web/sites/lib/lang/pl_web_vhost_domain.lng
index faa5dd0e627c5cfe11452ff7259fb4c47c352c3c..f0b797fb481377b561c45804d3f2ab1978b0c131 100644
--- a/interface/web/sites/lib/lang/pl_web_vhost_domain.lng
+++ b/interface/web/sites/lib/lang/pl_web_vhost_domain.lng
@@ -181,6 +181,7 @@ $wb["backup_format_tar_7z_lzma_txt"] = 'tar + 7z (LZMA)';
 $wb["backup_format_tar_7z_lzma2_txt"] = 'tar + 7z (LZMA2)';
 $wb["backup_format_tar_7z_ppmd_txt"] = 'tar + 7z (PPMd)';
 $wb["backup_format_tar_7z_bzip2_txt"] = 'tar + 7z (BZip2)';
+$wb['dependent_domains_txt'] = 'Dependent sub- / aliasdomains';
 $wb['error_ipv4_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv4 address.';
 $wb['error_ipv6_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv6 address.';
 $wb['error_domain_change_forbidden'] = 'The domain name cannot be changed. Please contact your administrator if you want to change the domain name.';
diff --git a/interface/web/sites/lib/lang/pt_web_vhost_domain.lng b/interface/web/sites/lib/lang/pt_web_vhost_domain.lng
index d5e554463c8f1f52460f45ad1d153551474c61a9..4314c959f9f91d53549fbc89d4a9a810e2a9071d 100644
--- a/interface/web/sites/lib/lang/pt_web_vhost_domain.lng
+++ b/interface/web/sites/lib/lang/pt_web_vhost_domain.lng
@@ -181,6 +181,7 @@ $wb["backup_format_tar_7z_lzma_txt"] = 'tar + 7z (LZMA)';
 $wb["backup_format_tar_7z_lzma2_txt"] = 'tar + 7z (LZMA2)';
 $wb["backup_format_tar_7z_ppmd_txt"] = 'tar + 7z (PPMd)';
 $wb["backup_format_tar_7z_bzip2_txt"] = 'tar + 7z (BZip2)';
+$wb['dependent_domains_txt'] = 'Dependent sub- / aliasdomains';
 $wb['error_ipv4_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv4 address.';
 $wb['error_ipv6_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv6 address.';
 $wb['error_domain_change_forbidden'] = 'The domain name cannot be changed. Please contact your administrator if you want to change the domain name.';
diff --git a/interface/web/sites/lib/lang/ro_web_vhost_domain.lng b/interface/web/sites/lib/lang/ro_web_vhost_domain.lng
index 7906eb8f9943d1c980ab5923106c9f06c2ed6e89..c905f8913295f23de30f20481c952dbbbb3dfa32 100644
--- a/interface/web/sites/lib/lang/ro_web_vhost_domain.lng
+++ b/interface/web/sites/lib/lang/ro_web_vhost_domain.lng
@@ -181,6 +181,7 @@ $wb["backup_format_tar_7z_lzma_txt"] = 'tar + 7z (LZMA)';
 $wb["backup_format_tar_7z_lzma2_txt"] = 'tar + 7z (LZMA2)';
 $wb["backup_format_tar_7z_ppmd_txt"] = 'tar + 7z (PPMd)';
 $wb["backup_format_tar_7z_bzip2_txt"] = 'tar + 7z (BZip2)';
+$wb['dependent_domains_txt'] = 'Dependent sub- / aliasdomains';
 $wb['error_ipv4_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv4 address.';
 $wb['error_ipv6_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv6 address.';
 $wb['error_domain_change_forbidden'] = 'The domain name cannot be changed. Please contact your administrator if you want to change the domain name.';
diff --git a/interface/web/sites/lib/lang/ru_web_vhost_domain.lng b/interface/web/sites/lib/lang/ru_web_vhost_domain.lng
index afb9d72fab01fae11c183d9bf63d94e3972faf84..25b05ff7f4d4bbad6d60353d8177a4960537bc5e 100644
--- a/interface/web/sites/lib/lang/ru_web_vhost_domain.lng
+++ b/interface/web/sites/lib/lang/ru_web_vhost_domain.lng
@@ -181,6 +181,7 @@ $wb["backup_format_tar_7z_lzma_txt"] = 'tar + 7z (LZMA)';
 $wb["backup_format_tar_7z_lzma2_txt"] = 'tar + 7z (LZMA2)';
 $wb["backup_format_tar_7z_ppmd_txt"] = 'tar + 7z (PPMd)';
 $wb["backup_format_tar_7z_bzip2_txt"] = 'tar + 7z (BZip2)';
+$wb['dependent_domains_txt'] = 'Dependent sub- / aliasdomains';
 $wb['error_ipv4_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv4 address.';
 $wb['error_ipv6_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv6 address.';
 $wb['error_domain_change_forbidden'] = 'The domain name cannot be changed. Please contact your administrator if you want to change the domain name.';
diff --git a/interface/web/sites/lib/lang/se_web_vhost_domain.lng b/interface/web/sites/lib/lang/se_web_vhost_domain.lng
index 91c126b69a815bc109a509877f98c7032ba9df61..63c261cb03d16c740dd0fb7605a48b74fee3df7b 100644
--- a/interface/web/sites/lib/lang/se_web_vhost_domain.lng
+++ b/interface/web/sites/lib/lang/se_web_vhost_domain.lng
@@ -181,6 +181,7 @@ $wb["backup_format_tar_7z_lzma_txt"] = 'tar + 7z (LZMA)';
 $wb["backup_format_tar_7z_lzma2_txt"] = 'tar + 7z (LZMA2)';
 $wb["backup_format_tar_7z_ppmd_txt"] = 'tar + 7z (PPMd)';
 $wb["backup_format_tar_7z_bzip2_txt"] = 'tar + 7z (BZip2)';
+$wb['dependent_domains_txt'] = 'Dependent sub- / aliasdomains';
 $wb['error_ipv4_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv4 address.';
 $wb['error_ipv6_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv6 address.';
 $wb['error_domain_change_forbidden'] = 'The domain name cannot be changed. Please contact your administrator if you want to change the domain name.';
diff --git a/interface/web/sites/lib/lang/sk_web_vhost_domain.lng b/interface/web/sites/lib/lang/sk_web_vhost_domain.lng
index d61f814f57bce259a3ca0a7b74a40d917acd1d55..6ff92e62e74764528c8d4379b88f74613ccafb8a 100644
--- a/interface/web/sites/lib/lang/sk_web_vhost_domain.lng
+++ b/interface/web/sites/lib/lang/sk_web_vhost_domain.lng
@@ -181,6 +181,7 @@ $wb["backup_format_tar_7z_lzma_txt"] = 'tar + 7z (LZMA)';
 $wb["backup_format_tar_7z_lzma2_txt"] = 'tar + 7z (LZMA2)';
 $wb["backup_format_tar_7z_ppmd_txt"] = 'tar + 7z (PPMd)';
 $wb["backup_format_tar_7z_bzip2_txt"] = 'tar + 7z (BZip2)';
+$wb['dependent_domains_txt'] = 'Dependent sub- / aliasdomains';
 $wb['error_ipv4_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv4 address.';
 $wb['error_ipv6_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv6 address.';
 $wb['error_domain_change_forbidden'] = 'The domain name cannot be changed. Please contact your administrator if you want to change the domain name.';
diff --git a/interface/web/sites/lib/lang/tr_web_vhost_domain.lng b/interface/web/sites/lib/lang/tr_web_vhost_domain.lng
index 6b81451fdd591d73624b229396f9ec123e1caf2c..dd1a8e0ca4760c031bd8bdde5b5cb328008c9ed0 100644
--- a/interface/web/sites/lib/lang/tr_web_vhost_domain.lng
+++ b/interface/web/sites/lib/lang/tr_web_vhost_domain.lng
@@ -183,6 +183,7 @@ $wb["backup_format_tar_7z_lzma_txt"] = 'tar + 7z (LZMA)';
 $wb["backup_format_tar_7z_lzma2_txt"] = 'tar + 7z (LZMA2)';
 $wb["backup_format_tar_7z_ppmd_txt"] = 'tar + 7z (PPMd)';
 $wb["backup_format_tar_7z_bzip2_txt"] = 'tar + 7z (BZip2)';
+$wb['dependent_domains_txt'] = 'Dependent sub- / aliasdomains';
 $wb['error_ipv4_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv4 address.';
 $wb['error_ipv6_change_forbidden'] = 'The IP cannot be changed. Please contact your administrator if you want to change the IPv6 address.';
 $wb['error_domain_change_forbidden'] = 'The domain name cannot be changed. Please contact your administrator if you want to change the domain name.';
diff --git a/interface/web/sites/templates/web_vhost_domain_edit.htm b/interface/web/sites/templates/web_vhost_domain_edit.htm
index 8728d9c571b038f7201363c00c20adbfef19859e..5e6b86f8d3d564367e6313a24d027a2c4dd68bb2 100644
--- a/interface/web/sites/templates/web_vhost_domain_edit.htm
+++ b/interface/web/sites/templates/web_vhost_domain_edit.htm
@@ -9,7 +9,7 @@
 
 
         {tmpl_hook name="begin_form"}
-		<tmpl_if name="vhostdomain_type" value="domain">
+    <tmpl_if name="vhostdomain_type" value="domain">
             <tmpl_if name="is_admin">
                 <div class="form-group">
                     <tmpl_if name="edit_disabled">
@@ -84,6 +84,15 @@
                     <tmpl_else>
                         <div class="col-sm-9"><input type="text" name="domain" id="domain" value="{tmpl_var name='domain'}" class="form-control" /></div></tmpl_if>
             </div>
+            <tmpl_if name="web_aliasdomains_info">
+            <div class="form-group">
+                   <label for="web_aliasdomains" class="col-sm-3 control-label">{tmpl_var name='dependent_domains_txt'}</label>
+                   <div class="col-sm-9">
+                           <textarea name="web_aliasdomains" id="web_aliasdomains" class="form-control" disabled="disabled"><tmpl_loop name="web_aliasdomains_info">{tmpl_var name='domain'}
+</tmpl_loop></textarea>
+                   </div>
+            </div>
+            </tmpl_if>
 			<tmpl_if name="edit_disabled">
 				<div class="form-group">
 					<label for="document_root" class="col-sm-3 control-label" readonly >{tmpl_var name='document_root_txt'}</label>
diff --git a/interface/web/sites/web_vhost_domain_edit.php b/interface/web/sites/web_vhost_domain_edit.php
index b6f2ac5fa822400471d177a2a4f4b7060f38df1a..a718ae8a87aab05cfd8385cc72c35b457ec7fdc6 100644
--- a/interface/web/sites/web_vhost_domain_edit.php
+++ b/interface/web/sites/web_vhost_domain_edit.php
@@ -945,6 +945,10 @@ class page_action extends tform_actions {
 	function onShowEdit() {
 		global $app;
 		if($app->tform->checkPerm($this->id, 'riud')) $app->tform->formDef['tabs']['domain']['readonly'] = false;
+		$sql = "SELECT domain_id, domain, type FROM web_domain WHERE (type='alias' OR type='subdomain') AND parent_domain_id = ?";
+		$subs = $app->db->queryAllRecords($sql, $this->id);
+		$app->tpl->setLoop('web_aliasdomains_info', $subs);
+
 		parent::onShowEdit();
 	}
 
@@ -1490,7 +1494,7 @@ class page_action extends tform_actions {
 					$rec = $app->db->queryOneRecord("SELECT server_id from web_domain WHERE domain_id = ?", $this->id);
 					if($rec['server_id'] != $this->dataRecord["server_id"]) {
 						//* Add a error message and switch back to old server
-						$app->tform->errorMessage .= $app->lng('error_server_change_not_possible');
+						$app->tform->errorMessage .= $app->tform->lng('error_server_change_not_possible');
 						$this->dataRecord["server_id"] = $rec['server_id'];
 					}
 					unset($rec);
@@ -1501,17 +1505,17 @@ class page_action extends tform_actions {
 				$rec = $app->db->queryOneRecord("SELECT sys_perm_group, domain, ip_address, ipv6_address from web_domain WHERE domain_id = ?", $this->id);
 				if(isset($this->dataRecord["domain"]) && $rec['domain'] != $this->dataRecord["domain"] && !$app->tform->checkPerm($this->id, 'u')) {
 					//* Add a error message and switch back to old server
-					$app->tform->errorMessage .= $app->lng('error_domain_change_forbidden');
+					$app->tform->errorMessage .= $app->tform->lng('error_domain_change_forbidden');
 					$this->dataRecord["domain"] = $rec['domain'];
 				}
 				if(isset($this->dataRecord["ip_address"]) && $rec['ip_address'] != $this->dataRecord["ip_address"] && $rec['sys_perm_group'] != 'riud') {
 					//* Add a error message and switch back to old server
-					$app->tform->errorMessage .= $app->lng('error_ipv4_change_forbidden');
+					$app->tform->errorMessage .= $app->tform->lng('error_ipv4_change_forbidden');
 					$this->dataRecord["ip_address"] = $rec['ip_address'];
 				}
 				if(isset($this->dataRecord["ipv6_address"]) && $rec['ipv6_address'] != $this->dataRecord["ipv6_address"] && $rec['sys_perm_group'] != 'riud') {
 					//* Add a error message and switch back to old server
-					$app->tform->errorMessage .= $app->lng('error_ipv6_change_forbidden');
+					$app->tform->errorMessage .= $app->tform->lng('error_ipv6_change_forbidden');
 					$this->dataRecord["ipv6_address"] = $rec['ipv6_address'];
 				}
 				unset($rec);
diff --git a/server/lib/classes/db_mysql.inc.php b/server/lib/classes/db_mysql.inc.php
index 8c381230961976b5152ae5bff25cd7fa00f3634a..df38086ebee7ff73d67ba437c36e7172b7a15c77 100644
--- a/server/lib/classes/db_mysql.inc.php
+++ b/server/lib/classes/db_mysql.inc.php
@@ -1106,6 +1106,75 @@ class db
 		}
 	}
 
+	/**
+	 * Get the database type (mariadb or mysql)
+	 *
+	 * @access public
+	 * @return string 'mariadb' or string 'mysql'
+	 */
+
+	public function getDatabaseType() {
+		$tmp = $this->queryOneRecord('SELECT VERSION() as version');
+		if(stristr($tmp['version'],'mariadb')) {
+			return 'mariadb';
+		} else {
+			return 'mysql';
+		}
+	}
+
+	/**
+	 * Get the database version
+	 *
+	 * @access public
+	 * @param bool   $major_version_only = true will return the major version only, e.g. 8 for MySQL 8
+	 * @return string version number
+	 */
+
+	public function getDatabaseVersion($major_version_only = false) {
+		$tmp = $this->queryOneRecord('SELECT VERSION() as version');
+		$version = explode('-', $tmp['version']);
+		if($major_version_only == true) {
+			$version_parts = explode('.', $version[0]);
+			return $version_parts[0];
+		} else {
+			return $version[0];
+		}
+	}
+	
+	/**
+	 * Get a mysql password hash
+	 *
+	 * @access public
+	 * @param string   cleartext password
+	 * @return string  Password hash
+	 */
+	
+	public function getPasswordHash($password) {
+		
+		$password_type = 'password';
+		
+		/* Disabled until caching_sha2_password is implemented
+		if($this->getDatabaseType() == 'mysql' && $this->getDatabaseVersion(true) >= 8) {
+			// we are in MySQL 8 mode
+			$tmp = $this->queryOneRecord("show variables like 'default_authentication_plugin'");
+			if($tmp['default_authentication_plugin'] == 'caching_sha2_password') {
+				$password_type = 'caching_sha2_password';
+			}
+		}
+		*/
+		
+		if($password_type == 'caching_sha2_password') {
+			/*
+				caching_sha2_password hashing needs to be implemented, have not 
+				found valid PHP implementation for the new password hash type.
+			*/
+		} else {
+			$password_hash = '*'.strtoupper(sha1(sha1($password, true)));
+		}
+		
+		return $password_hash;
+	}
+
 }
 
 /**
diff --git a/server/lib/classes/letsencrypt.inc.php b/server/lib/classes/letsencrypt.inc.php
index 3ce63b48b48d0a86f420c5b6a1fbc4415fa33644..fb67e7c00d5703796822e36d204b366092a4bb26 100644
--- a/server/lib/classes/letsencrypt.inc.php
+++ b/server/lib/classes/letsencrypt.inc.php
@@ -30,7 +30,7 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 class letsencrypt {
 
-	/** 
+	/**
 	 * Construct for this class
 	 *
 	 * @return system
@@ -373,13 +373,38 @@ class letsencrypt {
 			if((isset($web_config['skip_le_check']) && $web_config['skip_le_check'] == 'y') || (isset($server_config['migration_mode']) && $server_config['migration_mode'] == 'y')) {
 				$le_domains[] = $temp_domain;
 			} else {
-				$le_hash_check = trim(@file_get_contents('http://' . $temp_domain . '/.well-known/acme-challenge/' . $le_rnd_file));
-				if($le_hash_check == $le_rnd_hash) {
-					$le_domains[] = $temp_domain;
-					$app->log("Verified domain " . $temp_domain . " should be reachable for letsencrypt.", LOGLEVEL_DEBUG);
+				//check caa-record
+				$caa_check = false;
+				$caa_domain = $temp_domain;
+				$count = substr_count($caa_domain, '.');
+				if($count === 2) {
+					if(strlen(explode('.', $caa_domain)[1]) > 3) {
+						$caa_domain = explode('.', $caa_domain, 2)[1];
+ 					}
+				} else if($count > 2) {
+					$caa_domain = get_domain(explode('.', $caa_domain, 2)[1]);
+				}
+				$caa_records = @dns_get_record($caa_domain, DNS_CAA); // requieres PHP 7.0.16, 7.1.2
+				if(is_array($caa_records) && !empty($caa_records)) {
+					foreach ($caa_records as $record) {
+						if($record['value'] == 'letsencrypt.org') $caa_check = true;
+					}
+				} else {
+					$caa_check = true;
+				}
+
+				if($caa_check === true) {
+					$le_hash_check = trim(@file_get_contents('http://' . $temp_domain . '/.well-known/acme-challenge/' . $le_rnd_file));
+					if($le_hash_check == $le_rnd_hash) {
+						$le_domains[] = $temp_domain;
+						$app->log("Verified domain " . $temp_domain . " should be reachable for letsencrypt.", LOGLEVEL_DEBUG);
+					} else {
+						$app->log("Could not verify domain " . $temp_domain . ", so excluding it from letsencrypt request.", LOGLEVEL_WARN);
+					}
 				} else {
-					$app->log("Could not verify domain " . $temp_domain . ", so excluding it from letsencrypt request.", LOGLEVEL_WARN);
+					$app->log("Incomplete CAA-Records for " . $temp_domain . ", so excluding it from letsencrypt request.", LOGLEVEL_WARN);
 				}
+
 			}
 		}
 		$temp_domains = $le_domains;
diff --git a/server/plugins-available/maildeliver_plugin.inc.php b/server/plugins-available/maildeliver_plugin.inc.php
index 130d0a7f187ccfe6baea029754e0501c5cbfc589..168063c1a2a9307cfd81c882ab890c9878507661 100644
--- a/server/plugins-available/maildeliver_plugin.inc.php
+++ b/server/plugins-available/maildeliver_plugin.inc.php
@@ -93,6 +93,7 @@ class maildeliver_plugin {
 			or $data["old"]["autoresponder_start_date"] != $data["new"]["autoresponder_start_date"]
 			or $data["old"]["autoresponder_end_date"] != $data["new"]["autoresponder_end_date"]
 			or $data["old"]["cc"] != $data["new"]["cc"]
+			or $data["old"]["forward_in_lda"] != $data["new"]["forward_in_lda"]
 		) {
 
 			$app->log("Mailfilter config has been changed", LOGLEVEL_DEBUG);
@@ -121,14 +122,16 @@ class maildeliver_plugin {
 				$tpl->newTemplate("sieve_filter.master");
 
 				// cc Field
-				$tmp_mails_arr = explode(',',$data["new"]["cc"]);
-				$tmp_addresses_arr = array();
-				foreach($tmp_mails_arr as $address) {
-					if(trim($address) != '') $tmp_addresses_arr[] = array('address' => trim($address));
-				}
+				if ($data["new"]["forward_in_lda"] == 'y' && $data["new"]["cc"] != '') {
+					$tmp_mails_arr = explode(',',$data["new"]["cc"]);
+					$tmp_addresses_arr = array();
+					foreach($tmp_mails_arr as $address) {
+						if(trim($address) != '') $tmp_addresses_arr[] = array('address' => trim($address));
+					}
 			
-				$tpl->setVar('cc', $data["new"]["cc"]);
-				$tpl->setLoop('ccloop', $tmp_addresses_arr);
+					$tpl->setVar('cc', $data["new"]["cc"]);
+					$tpl->setLoop('ccloop', $tmp_addresses_arr);
+				}
 
 				// Custom filters
 				if($data["new"]["custom_mailfilter"] == 'NULL') $data["new"]["custom_mailfilter"] = '';
diff --git a/server/plugins-available/maildrop_plugin.inc.php b/server/plugins-available/maildrop_plugin.inc.php
index 00777a1662e7c9a7dea5deddbf70ee6ac563a1a6..e1b559b367432cfb4349e6fd4e9f376e048cb22b 100644
--- a/server/plugins-available/maildrop_plugin.inc.php
+++ b/server/plugins-available/maildrop_plugin.inc.php
@@ -176,7 +176,9 @@ class maildrop_plugin {
 		// Write the custom mailfilter script, if mailfilter recipe has changed
 		if($data["old"]["custom_mailfilter"] != $data["new"]["custom_mailfilter"]
 			or $data["old"]["move_junk"] != $data["new"]["move_junk"]
-			or $data["old"]["cc"] != $data["new"]["cc"]) {
+			or $data["old"]["cc"] != $data["new"]["cc"]
+			or $data["old"]["forward_in_lda"] != $data["new"]["forward_in_lda"]
+		) {
 
 			$app->log("Mailfilter config has been changed", LOGLEVEL_DEBUG);
 			if(trim($data["new"]["custom_mailfilter"]) != ''
@@ -198,7 +200,7 @@ class maildrop_plugin {
 
 				$mailfilter_content = '';
 
-				if($data["new"]["cc"] != '') {
+				if ($data["new"]["forward_in_lda"] == 'y' && $data["new"]["cc"] != '') {
 					$tmp_mails_arr = explode(',',$data["new"]["cc"]);
 					foreach($tmp_mails_arr as $address) {
 						if(trim($address) != '') $mailfilter_content .= "cc \"!".trim($address)."\"\n";
diff --git a/server/plugins-available/mysql_clientdb_plugin.inc.php b/server/plugins-available/mysql_clientdb_plugin.inc.php
index e1fba6e18082c4fda64addbb5a293bc3b9940f95..f28e6006ce1de08ae7bbe6e0d48aea0206bcf0e4 100644
--- a/server/plugins-available/mysql_clientdb_plugin.inc.php
+++ b/server/plugins-available/mysql_clientdb_plugin.inc.php
@@ -101,12 +101,7 @@ class mysql_clientdb_plugin {
 
 		$success = true;
 		if(!preg_match('/\*[A-F0-9]{40}$/', $database_password)) {
-				$result = $link->query("SELECT PASSWORD('" . $link->escape_string($database_password) . "') as `crypted`");
-				if($result) {
-						$row = $result->fetch_assoc();
-						$database_password = $row['crypted'];
-						$result->free();
-				}
+				$database_password = $app->db->getPasswordHash($password);
 		}
 
 		$app->log("Calling $action for $database_name with access $user_access_mode and hosts " . implode(', ', $host_list), LOGLEVEL_DEBUG);
@@ -151,9 +146,32 @@ class mysql_clientdb_plugin {
 					$success = true;
 				}
 
-				if(!$link->query("GRANT " . $grants . " ON `".$database_name."`.* TO '".$link->escape_string($database_user)."'@'$db_host' IDENTIFIED BY PASSWORD '".$link->escape_string($database_password)."'")) $success = false;
-				$app->log("GRANT " . $grants . " ON `".$database_name."`.* TO '".$link->escape_string($database_user)."'@'$db_host' IDENTIFIED BY PASSWORD '".$link->escape_string($database_password)."' success? " . ($success ? 'yes' : 'no'), LOGLEVEL_DEBUG);
-			} elseif($action == 'REVOKE') {
+				// Create the user
+				$link->query("CREATE USER '".$link->escape_string($database_user)."'@'$db_host'");
+				$app->log("CREATE USER '".$link->escape_string($database_user)."'@'$db_host'", LOGLEVEL_DEBUG);
+
+				// set the password
+				// MySQL < 5.7 and MariadB 10
+				if(!$link->query("UPDATE mysql.user SET `Password` = '".$link->escape_string($database_password)."' WHERE `Host` = '".$db_host."' AND `User` = '".$link->escape_string($database_user)."'")) {
+					if($this->getDatabaseType($link) == 'mysql' && $this->getDatabaseVersion($link, true) >= 8) {
+						// for MySQL >= 8, we set authentication plugin to old mode to ensure that older additional php versions can still connect to the database
+						if(!$link->query("UPDATE mysql.user SET `authentication_string` = '".$link->escape_string($database_password)."', `plugin` = 'mysql_native_password' WHERE `Host` = '".$db_host."' AND `User` = '".$link->escape_string($database_user)."'")) $success = false;
+					} else {
+						// MySQL 5.7, the Password field has been renamed to authentication_string
+						if(!$link->query("UPDATE mysql.user SET `authentication_string` = '".$link->escape_string($database_password)."' WHERE `Host` = '".$db_host."' AND `User` = '".$link->escape_string($database_user)."'")) $success = false;
+					}
+				}
+				
+				if($success == true){
+					$link->query("FLUSH PRIVILEGES");
+					$app->log("PASSWORD SET FOR '".$link->escape_string($database_user)."'@'$db_host' success? " . ($success ? 'yes' : 'no'), LOGLEVEL_DEBUG);
+				} 
+
+				// Set the grant
+				if(!$link->query("GRANT " . $grants . " ON `".$link->escape_string($database_name)."`.* TO '".$link->escape_string($database_user)."'@'$db_host'")) $success = false;
+				$app->log("GRANT " . $grants . " ON `".$link->escape_string($database_name)."`.* TO '".$link->escape_string($database_user)."'@'$db_host' success? " . ($success ? 'yes' : 'no'), LOGLEVEL_DEBUG);
+
+				} elseif($action == 'REVOKE') {
 				if(!$link->query("REVOKE ALL PRIVILEGES ON `".$database_name."`.* FROM '".$link->escape_string($database_user)."'@'$db_host'")) $success = false;
 			} elseif($action == 'DROP') {
 				if(!$link->query("DROP USER '".$link->escape_string($database_user)."'@'$db_host'")) $success = false;
@@ -165,8 +183,13 @@ class mysql_clientdb_plugin {
 				if(trim($database_password) != '') {
 					// MySQL < 5.7 and MariadB 10
 					if(!$link->query("UPDATE mysql.user SET `Password` = '".$link->escape_string($database_password)."' WHERE `Host` = '".$db_host."' AND `User` = '".$link->escape_string($database_user)."'")) {
-						// MySQL 5.7, the Password field has been renamed to authentication_string
-						if(!$link->query("UPDATE mysql.user SET `authentication_string` = '".$link->escape_string($database_password)."' WHERE `Host` = '".$db_host."' AND `User` = '".$link->escape_string($database_user)."'")) $success = false;
+						if($this->getDatabaseType($link) == 'mysql' && $this->getDatabaseVersion($link, true) >= 8) {
+							// for MySQL >= 8, we set authentication plugin to old mode to ensure that older additional php versions can still connect to the database
+							if(!$link->query("UPDATE mysql.user SET `authentication_string` = '".$link->escape_string($database_password)."', `plugin` = 'mysql_native_password' WHERE `Host` = '".$db_host."' AND `User` = '".$link->escape_string($database_user)."'")) $success = false;
+						} else {
+							// MySQL 5.7, the Password field has been renamed to authentication_string
+							if(!$link->query("UPDATE mysql.user SET `authentication_string` = '".$link->escape_string($database_password)."' WHERE `Host` = '".$db_host."' AND `User` = '".$link->escape_string($database_user)."'")) $success = false;
+						}
 					}
 					if($success == true) $link->query("FLUSH PRIVILEGES");
 				}
@@ -772,6 +795,43 @@ class mysql_clientdb_plugin {
 
 		$link->close();
 	}
+	
+	
+				
+				
+	function getDatabaseType($link) {
+		$result = $link->query('SELECT VERSION() as version');
+		if($result) {
+			$tmp = $result->fetch_assoc();
+			$result->free();
+			
+			if(stristr($tmp['version'],'mariadb')) {
+				return 'mariadb';
+			} else {
+				return 'mysql';
+			}
+		} else {
+			return false;
+		}
+	}
+
+	function getDatabaseVersion($link, $major_version_only = false) {
+		$result = $link->query('SELECT VERSION() as version');
+		if($result) {
+			$tmp = $result->fetch_assoc();
+			$result->free();
+			
+			$version = explode('-', $tmp['version']);
+			if($major_version_only == true) {
+				$version_parts = explode('.', $version[0]);
+				return $version_parts[0];
+			} else {
+				return $version[0];
+			}
+		} else {
+			return false;
+		}
+	}
 
 } // end class
 
diff --git a/server/scripts/ispconfig_update.php b/server/scripts/ispconfig_update.php
index 2c77607b6576a44bf8fb0a6ca70c9a4f3d94d214..e71b501a7c11d2b9686c4543309c661f67327a11 100644
--- a/server/scripts/ispconfig_update.php
+++ b/server/scripts/ispconfig_update.php
@@ -88,25 +88,18 @@ echo "\n".str_repeat('-', 80)."\n";
 echo "\n\n>> Update  \n\n";
 echo "Please choose the update method. For production systems select 'stable'. \nWARNING: The update from GIT is only for development systems and may break your current setup. Do not use the GIT version on servers that host any live websites!\nNote: Update all slave server, before you update master server.\n\n";
 
-$method = simple_query('Select update method', array('stable', 'git-stable', 'git-master'), 'stable');
+$method = simple_query('Select update method', array('stable', 'nightly', 'git-develop'), 'stable');
 
 if($method == 'stable') {
 	$new_version = @file_get_contents('https://www.ispconfig.org/downloads/ispconfig3_version.txt') or die('Unable to retrieve version file.');
 	$new_version = trim($new_version);
-	if(version_compare($new_version, ISPC_APP_VERSION, '>')) {
-		passthru('/usr/local/ispconfig/server/scripts/update_stable.sh');
-		exit;
-	} else {
+	if(version_compare($new_version, ISPC_APP_VERSION, '<=') && !in_array('--force', $argv, true)) {
 		echo "There are no updates available for ISPConfig ".ISPC_APP_VERSION."\n";
+		echo "If you are sure you want to update to stable anyway, please use --force parameter\n";
+		echo "DOWNGRADING MAY CAUSE ISSUES!\n";
+		exit(1);
 	}
-} elseif ($method == 'git-stable') {
-	passthru('/usr/local/ispconfig/server/scripts/update_from_dev_stable.sh');
-	exit;
-} else {
-	passthru('/usr/local/ispconfig/server/scripts/update_from_dev.sh');
-	exit;
 }
 
-
-
-?>
+passthru('/usr/local/ispconfig/server/scripts/update_runner.sh ' . escapeshellarg($method));
+exit;
diff --git a/server/scripts/letsencrypt_post_hook.sh b/server/scripts/letsencrypt_post_hook.sh
new file mode 100644
index 0000000000000000000000000000000000000000..02653f79a1112d94087c9441326b2714d115f600
--- /dev/null
+++ b/server/scripts/letsencrypt_post_hook.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+
+### BEGIN INIT INFO
+# Provides: LETSENCRYPT POST HOOK SCRIPT
+# Required-Start:  $local_fs $network
+# Required-Stop:  $local_fs
+# Default-Start:  2 3 4 5
+# Default-Stop:  0 1 6
+# Short-Description: LETSENCRYPT POST HOOK SCRIPT
+# Description:  To force close http port 80 if it is by default closed, to be used by letsencrypt client standlone command
+### END INIT INFO
+
+## If you need a custom hook file, create a file with the same name in
+## /usr/local/ispconfig/server/conf-custom/scripts/
+if [[ -e "/usr/local/ispconfig/server/conf-custom/scripts/letsencrypt_post_hook.sh" ]] ; then
+	. /usr/local/ispconfig/server/conf-custom/scripts/letsencrypt_post_hook.sh && exit 0 || exit 1;
+fi
+
+# You can add support to other firewall
+
+# For RHEL, Centos or derivatives
+if which yum &> /dev/null 2>&1 ; then
+    # Check if web server software is installed, start it if any
+    if [ rpm -q nginx ]; then service nginx start
+    elif [ rpm -q httpd ]; then service httpd start
+    # If using firewalld
+    elif [ rpm -q firewalld ] && [ `firewall-cmd --state` = running ]; then
+        firewall-cmd --zone=public --permanent --remove-service=http
+        firewall-cmd --reload
+    # If using UFW
+    else; if [ rpm -q ufw ]; then ufw --force enable && ufw deny http; fi
+    fi
+# For Debian, Ubuntu or derivatives
+elif apt-get -v >/dev/null 2>&1 ; then
+    # Check if web server software is installed, stop it if any
+    if [ $(dpkg-query -W -f='${Status}' nginx 2>/dev/null | grep -c "ok installed") -eq 1 ]; then service nginx start
+    elif [ $(dpkg-query -W -f='${Status}' apache2 2>/dev/null | grep -c "ok installed") -eq 1 ]; then service apache2 start
+    # If using UFW
+    else; if [ $(dpkg-query -W -f='${Status}' ufw 2>/dev/null | grep -c "ok installed") -eq 1 ]; then ufw --force enable && ufw deny http; fi
+    fi
+# Try iptables as a final attempt
+else
+    iptables -D INPUT  -p tcp  --dport 80    -j ACCEPT
+    service iptables save
+fi
\ No newline at end of file
diff --git a/server/scripts/letsencrypt_pre_hook.sh b/server/scripts/letsencrypt_pre_hook.sh
new file mode 100644
index 0000000000000000000000000000000000000000..56f246e8037d4f456b691d87a378be4dd22ebaac
--- /dev/null
+++ b/server/scripts/letsencrypt_pre_hook.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+### BEGIN INIT INFO
+# Provides: LETSENCRYPT PRE HOOK SCRIPT
+# Required-Start:  $local_fs $network
+# Required-Stop:  $local_fs
+# Default-Start:  2 3 4 5
+# Default-Stop:  0 1 6
+# Short-Description: LETSENCRYPT PRE HOOK SCRIPT
+# Description:  To force open http port 80 to be used by letsencrypt client standlone command
+### END INIT INFO
+
+## If you need a custom hook file, create a file with the same name in
+## /usr/local/ispconfig/server/conf-custom/scripts/
+if [[ -e "/usr/local/ispconfig/server/conf-custom/scripts/letsencrypt_pre_hook.sh" ]] ; then
+	. /usr/local/ispconfig/server/conf-custom/scripts/letsencrypt_pre_hook.sh && exit 0 || exit 1 ;
+fi
+
+# You can add support to other firewall
+
+# For RHEL, Centos or derivatives
+if which yum &> /dev/null 2>&1 ; then
+    # Check if web server software is installed, stop it if any
+    if [ rpm -q nginx ]; then service nginx stop; fi
+    if [ rpm -q httpd ]; then service httpd stop; fi
+    # If using firewalld
+    if [ rpm -q firewalld ] && [ `firewall-cmd --state` = running ]; then
+        firewall-cmd --zone=public --permanent --add-service=http
+        firewall-cmd --reload
+    fi
+    # If using UFW
+    if [ rpm -q ufw ]; then ufw --force enable && ufw allow http; fi
+
+# For Debian, Ubuntu or derivatives
+elif apt-get -v >/dev/null 2>&1 ; then
+    # Check if web server software is installed, stop it if any
+    if [ $(dpkg-query -W -f='${Status}' nginx 2>/dev/null | grep -c "ok installed") -eq 1 ]; then service nginx stop; fi
+    if [ $(dpkg-query -W -f='${Status}' apache2 2>/dev/null | grep -c "ok installed") -eq 1 ]; then service apache2 stop; fi
+    # If using UFW
+    if [ $(dpkg-query -W -f='${Status}' ufw 2>/dev/null | grep -c "ok installed") -eq 1 ]; then ufw --force enable && ufw allow http; fi
+    
+# Try iptables as a final attempt
+else
+    iptables -I INPUT  -p tcp  --dport 80    -j ACCEPT
+    service iptables save
+fi
diff --git a/server/scripts/letsencrypt_renew_hook.sh b/server/scripts/letsencrypt_renew_hook.sh
new file mode 100644
index 0000000000000000000000000000000000000000..0a71f30d01d0e14ea7f8e065bbcc11c1608d576b
--- /dev/null
+++ b/server/scripts/letsencrypt_renew_hook.sh
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+### BEGIN INIT INFO
+# Provides: LETSENCRYPT RENEW HOOK SCRIPT
+# Required-Start:  $local_fs $network
+# Required-Stop:  $local_fs
+# Default-Start:  2 3 4 5
+# Default-Stop:  0 1 6
+# Short-Description: LETSENCRYPT RENEW HOOK SCRIPT
+# Description:  Taken from LE4ISPC code. To be used to update ispserver.pem automatically after ISPConfig LE SSL certs are renewed and to reload / restart important ISPConfig server services
+### END INIT INFO
+
+## If you need a custom hook file, create a file with the same name in
+## /usr/local/ispconfig/server/conf-custom/scripts/
+if [[ -e "/usr/local/ispconfig/server/conf-custom/scripts/letsencrypt_renew_hook.sh" ]] ; then
+	. /usr/local/ispconfig/server/conf-custom/scripts/letsencrypt_renew_hook.sh && exit 0 || exit 1;
+fi
+
+lelive=/etc/letsencrypt/live/$(hostname -f); if [ -d "$lelive" ]; then
+    cd /usr/local/ispconfig/interface/ssl; ibak=ispserver.*.bak; ipem=ispserver.pem; icrt=ispserver.crt; ikey=ispserver.key
+    if ls $ibak 1> /dev/null 2>&1; then rm $ibak; fi
+    if [ -e "$ipem" ]; then mv $ipem $ipem-$(date +"%y%m%d%H%M%S").bak; cat $ikey $icrt > $ipem; chmod 600 $ipem; fi
+    pureftpdpem=/etc/ssl/private/pure-ftpd.pem; if [ -e "$pureftpdpem" ]; then chmod 600 $pureftpdpem; fi
+    # For Red Hat, Centos or derivatives
+    if which yum &> /dev/null 2>&1 ; then
+        if [ rpm -q pure-ftpd ]; then service pure-ftpd restart; fi
+        if [ rpm -q monit ]; then service monit restart; fi
+        if [ rpm -q postfix ]; then service postfix restart; fi
+        if [ rpm -q dovecot ]; then service dovecot restart; fi
+        if [ rpm -q mysql-server ]; then service mysqld restart; fi
+        if [ rpm -q mariadb-server ]; then service mariadb restart; fi
+        if [ rpm -q MariaDB-server ]; then service mysql restart; fi
+        if [ rpm -q nginx ]; then service nginx restart; fi
+        if [ rpm -q httpd ]; then service httpd restart; fi
+    # For Debian, Ubuntu or derivatives
+    elif apt-get -v >/dev/null 2>&1 ; then
+        if [ $(dpkg-query -W -f='${Status}' pure-ftpd-mysql 2>/dev/null | grep -c "ok installed") -eq 1 ]; then service pure-ftpd-mysql restart; fi
+        if [ $(dpkg-query -W -f='${Status}' monit 2>/dev/null | grep -c "ok installed") -eq 1 ]; then service monit restart; fi
+        if [ $(dpkg-query -W -f='${Status}' postfix 2>/dev/null | grep -c "ok installed") -eq 1 ]; then service postfix restart; fi
+        if [ $(dpkg-query -W -f='${Status}' dovecot-imapd 2>/dev/null | grep -c "ok installed") -eq 1 ]; then service dovecot restart; fi
+        if [ $(dpkg-query -W -f='${Status}' mysql 2>/dev/null | grep -c "ok installed") -eq 1 ]; then service mysql restart; fi
+        if [ $(dpkg-query -W -f='${Status}' mariadb 2>/dev/null | grep -c "ok installed") -eq 1 ]; then service mysql restart; fi
+        if [ $(dpkg-query -W -f='${Status}' nginx 2>/dev/null | grep -c "ok installed") -eq 1 ]; then service nginx restart; fi
+        if [ $(dpkg-query -W -f='${Status}' apache2 2>/dev/null | grep -c "ok installed") -eq 1 ]; then service apache2 restart; fi
+    else
+    fi
+else echo `/bin/date` "Your Lets Encrypt SSL certs path for your ISPConfig server FQDN is missing.$line" >> /var/log/ispconfig/ispconfig.log; fi
\ No newline at end of file
diff --git a/server/scripts/update_from_dev.sh b/server/scripts/update_from_dev.sh
index 0be65986d68b56fcf97e536447be8676f2ab7c24..430a1b5c7f7cab797648a182c090041372e8e352 100755
--- a/server/scripts/update_from_dev.sh
+++ b/server/scripts/update_from_dev.sh
@@ -1,29 +1,5 @@
 #!/bin/bash
 
-{
-    umask 0077 \
-    && tmpdir=`mktemp -dt "$(basename $0).XXXXXXXXXX"` \
-    && test -d "${tmpdir}" \
-    && cd "${tmpdir}"
-} || {
-    echo 'mktemp failed'
-    exit 1
-}
+echo "This script is no longer used. Please use ispconfig_update.sh instead." ;
 
-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:  "
-ls -1d ispconfig3-master*
-cd ispconfig3-master*/install
-
-php -q \
-    -d disable_classes= \
-    -d disable_functions= \
-    -d open_basedir= \
-    update.php
-
-cd /tmp
-rm -rf "${tmpdir}"
-
-exit 0
+exit 1;
diff --git a/server/scripts/update_from_dev_stable.sh b/server/scripts/update_from_dev_stable.sh
index a5dc10605b1ce72f36cb5116067d077702d0f62f..430a1b5c7f7cab797648a182c090041372e8e352 100644
--- a/server/scripts/update_from_dev_stable.sh
+++ b/server/scripts/update_from_dev_stable.sh
@@ -1,29 +1,5 @@
 #!/bin/bash
 
-{
-    umask 0077 \
-    && tmpdir=`mktemp -dt "$(basename $0).XXXXXXXXXX"` \
-    && test -d "${tmpdir}" \
-    && cd "${tmpdir}"
-} || {
-    echo 'mktemp failed'
-    exit 1
-}
+echo "This script is no longer used. Please use ispconfig_update.sh instead." ;
 
-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:  "
-ls -1d ispconfig3-stable*
-cd ispconfig3-stable*/install
-
-php -q \
-    -d disable_classes= \
-    -d disable_functions= \
-    -d open_basedir= \
-    update.php
-
-cd /tmp
-rm -rf "${tmpdir}"
-
-exit 0
+exit 1;
diff --git a/server/scripts/update_runner.sh b/server/scripts/update_runner.sh
new file mode 100644
index 0000000000000000000000000000000000000000..5647272f3a4831ea661aa2b064d49db710de641b
--- /dev/null
+++ b/server/scripts/update_runner.sh
@@ -0,0 +1,74 @@
+#!/bin/bash
+
+_UPD=1
+
+# padding handles script being overwritten during updates
+# see https://git.ispconfig.org/ispconfig/ispconfig3/issues/4227
+
+##################################################
+##################################################
+##################################################
+##################################################
+##################################################
+##################################################
+##################################################
+##################################################
+##################################################
+##################################################
+##################################################
+##################################################
+
+SOURCE=$1
+URL=""
+
+if [[ "$SOURCE" == "stable" ]] ; then
+	URL="https://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz"
+elif [[ "$SOURCE" == "nightly" ]] ; then
+	URL="https://www.ispconfig.org/downloads/ISPConfig-3-nightly.tar.gz"
+elif [[ "$SOURCE" == "git-develop" ]] ; then
+	URL="https://git.ispconfig.org/ispconfig/ispconfig3/repository/archive.tar.gz?ref=develop"
+else 
+	echo "Please choose an installation source (stable, nightly, git-develop)"
+	exit 1
+fi
+
+CURDIR=$PWD
+
+cd /tmp
+
+{
+if [ -n "${_UPD}" ]
+then
+    {
+        umask 0077 \
+        && tmpdir=`mktemp -dt "$(basename $0).XXXXXXXXXX"` \
+        && test -d "${tmpdir}" \
+        && cd "${tmpdir}"
+    } || {
+        echo 'mktemp failed'
+        exit 1
+    }
+
+    wget -O ISPConfig-3.tar.gz "${URL}"
+    if [ -f ISPConfig-3.tar.gz ]
+    then
+        tar xvzf ISPConfig-3.tar.gz --strip-components=1
+        cd install/
+        php -q \
+            -d disable_classes= \
+            -d disable_functions= \
+            -d open_basedir= \
+            update.php
+        cd /tmp
+        rm -rf "${tmpdir}"
+    else
+        echo "Unable to download the update."
+		cd "$CURDIR"
+        exit 1
+    fi
+
+fi
+
+cd "$CURDIR"
+exit 0
+}
diff --git a/server/scripts/update_stable.sh b/server/scripts/update_stable.sh
index 854731077e764ff10a4c14e83d75793edc032847..430a1b5c7f7cab797648a182c090041372e8e352 100644
--- a/server/scripts/update_stable.sh
+++ b/server/scripts/update_stable.sh
@@ -1,54 +1,5 @@
 #!/bin/bash
 
-_UPD=1
+echo "This script is no longer used. Please use ispconfig_update.sh instead." ;
 
-# padding handles script being overwritten during updates
-# see https://git.ispconfig.org/ispconfig/ispconfig3/issues/4227
-
-##################################################
-##################################################
-##################################################
-##################################################
-##################################################
-##################################################
-##################################################
-##################################################
-##################################################
-##################################################
-##################################################
-##################################################
-
-{
-if [ -n "${_UPD}" ]
-then
-    {
-        umask 0077 \
-        && tmpdir=`mktemp -dt "$(basename $0).XXXXXXXXXX"` \
-        && test -d "${tmpdir}" \
-        && cd "${tmpdir}"
-    } || {
-        echo 'mktemp failed'
-        exit 1
-    }
-
-    wget https://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz
-    if [ -f ISPConfig-3-stable.tar.gz ]
-    then
-        tar xvfz ISPConfig-3-stable.tar.gz
-        cd ispconfig3_install/install/
-        php -q \
-            -d disable_classes= \
-            -d disable_functions= \
-            -d open_basedir= \
-            update.php
-        cd /tmp
-        rm -rf "${tmpdir}"
-    else
-        echo "Unable to download the update."
-        exit 1
-    fi
-
-fi
-
-exit 0
-}
+exit 1;