From e28564dbde4f922a6a8263e3dea32d56b60b5b5b Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Wed, 16 Jun 2010 11:41:46 -0400
Subject: [PATCH] Implemented: FS#468 - Client name conversion in FTP user too restricted

---
 server/plugins-available/postfix_server_plugin.inc.php |   23 ++++++++++++++++++++---
 1 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/server/plugins-available/postfix_server_plugin.inc.php b/server/plugins-available/postfix_server_plugin.inc.php
index a63eb95..3732cc7 100644
--- a/server/plugins-available/postfix_server_plugin.inc.php
+++ b/server/plugins-available/postfix_server_plugin.inc.php
@@ -36,6 +36,19 @@
 	
 	var $postfix_config_dir = '/etc/postfix';
 	
+	//* This function is called during ispconfig installation to determine
+	//  if a symlink shall be created for this plugin.
+	function onInstall() {
+		global $conf;
+		
+		if($conf['services']['mail'] == true) {
+			return true;
+		} else {
+			return false;
+		}
+		
+	}
+	
 	/*
 	 	This function is called when the plugin is loaded
 	*/
@@ -73,7 +86,11 @@
 		
 		if($mail_config["relayhost"] != '') {
 			exec("postconf -e 'relayhost = ".$mail_config["relayhost"]."'");
-			exec("postconf -e 'smtp_sasl_auth_enable = yes'");
+			if($mail_config["relayhost_user"] != '' && $mail_config["relayhost_password"] != '') {
+				exec("postconf -e 'smtp_sasl_auth_enable = yes'");
+			} else {
+				exec("postconf -e 'smtp_sasl_auth_enable = no'");
+			}
 			exec("postconf -e 'smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd'");
 			exec("postconf -e 'smtp_sasl_security_options ='");
 			
@@ -89,8 +106,8 @@
 			exec("postconf -e 'relayhost ='");
 		}
 		
-		exec("postconf -e 'mailbox_size_limit = ".intval($mail_config["mailbox_size_limit"])."'");
-		exec("postconf -e 'message_size_limit = ".intval($mail_config["message_size_limit"])."'");
+		exec("postconf -e 'mailbox_size_limit = ".intval($mail_config["mailbox_size_limit"]*1024*1024)."'");
+		exec("postconf -e 'message_size_limit = ".intval($mail_config["message_size_limit"]*1024*1024)."'");
 		
 	}
 

--
Gitblit v1.9.1