From 864ee2fed1799104503f3105392a3edff8497aa9 Mon Sep 17 00:00:00 2001
From: xaver <xaver@ispconfig3>
Date: Thu, 15 Sep 2011 16:36:36 -0400
Subject: [PATCH] fix #1747 - check for amavised for postfix rules -> pure webserver need for php sendmail, most often postfix is used for it, because admin know it. I checked different repos for differnet names, alwas amavsid or with -new.

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

diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php
index e7296db..08e4649 100644
--- a/install/lib/installer_base.lib.php
+++ b/install/lib/installer_base.lib.php
@@ -909,10 +909,19 @@
 
 
 		// Adding the amavisd commands to the postfix configuration
-		$postconf_commands = array (
-				'content_filter = amavis:[127.0.0.1]:10024',
-				'receive_override_options = no_address_mappings'
-		);
+		// Add array for no error in foreach and maybe future options
+		$postconf_commands = array ();
+		
+		// Check for amavisd -> pure webserver with postfix for mailing without antispam
+		// Check for different names
+		system('which amavisd-new', $retval); // Debian, Ubuntu, ?
+		if ($retval !== 0){
+			system('which amavisd', $retval); // CentOS
+		}
+		if ($retval === 0) {
+			$postconf_commands[] = 'content_filter = amavis:[127.0.0.1]:10024';
+			$postconf_commands[] = 'receive_override_options = no_address_mappings';
+		}
 
 		// Make a backup copy of the main.cf file
 		copy($conf['postfix']['config_dir'].'/main.cf',$conf['postfix']['config_dir'].'/main.cf~2');

--
Gitblit v1.9.1