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/dist/lib/opensuse.lib.php |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/install/dist/lib/opensuse.lib.php b/install/dist/lib/opensuse.lib.php
index c1d0ce5..5737b24 100644
--- a/install/dist/lib/opensuse.lib.php
+++ b/install/dist/lib/opensuse.lib.php
@@ -96,11 +96,9 @@
 		}
 		
 		if($cf['vmail_mailbox_base'] != '' && strlen($cf['vmail_mailbox_base']) >= 10 && $this->is_update === false) exec('chown -R '.$cf['vmail_username'].':'.$cf['vmail_groupname'].' '.$cf['vmail_mailbox_base']);
-
+		
+		//* 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',
 			'virtual_alias_domains =',
 			'virtual_alias_maps = proxy:mysql:'.$config_dir.'/mysql-virtual_forwardings.cf, mysql:'.$config_dir.'/mysql-virtual_email2email.cf',
 			'virtual_mailbox_domains = proxy:mysql:'.$config_dir.'/mysql-virtual_domains.cf',
@@ -132,6 +130,15 @@
 			'inet_interfaces = all'
 		);
 		
+		//* 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');
 		touch($config_dir.'/mime_header_checks');

--
Gitblit v1.9.1