From a017a511fd078dce01f97383726d15308e1257a0 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Wed, 07 Mar 2012 06:02:12 -0500
Subject: [PATCH] Dont set myhostname, mydomain and mynetworks on update in main.cf

---
 install/lib/installer_base.lib.php |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php
index 0cc24d1..e65a08c 100644
--- a/install/lib/installer_base.lib.php
+++ b/install/lib/installer_base.lib.php
@@ -628,11 +628,9 @@
 
 		$command = 'useradd -g '.$cf['vmail_groupname'].' -u '.$cf['vmail_userid'].' '.$cf['vmail_username'].' -d '.$cf['vmail_mailbox_base'].' -m';
 		if(!is_user($cf['vmail_username'])) caselog("$command &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
-
+		
+		//* These postconf commands will be executed on installation and update
 		$postconf_commands = array (
-				'myhostname = '.$conf['hostname'],
-				'mydestination = '.$conf['hostname'].', localhost, localhost.localdomain',
-				'mynetworks = 127.0.0.0/8 [::1]/128',
 				'alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases',
 				'alias_database = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases',
 				'virtual_alias_domains =',
@@ -666,6 +664,15 @@
 				'body_checks = regexp:'.$config_dir.'/body_checks',
 				'owner_request_special = no'
 		);
+		
+		//* These postconf commands will be executed on installation only
+		if($this->is_update == false) {
+			$postconf_commands = array_merge($postconf_commands,array(
+				'myhostname = '.$conf['hostname'],
+				'mydestination = '.$conf['hostname'].', localhost, localhost.localdomain',
+				'mynetworks = 127.0.0.0/8 [::1]/128'
+			));
+		}
 
 		//* Create the header and body check files
 		touch($config_dir.'/header_checks');

--
Gitblit v1.9.1