From 77cc4a99b15f4639b56c29a1207dc04b459c5d54 Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Fri, 19 Dec 2014 12:18:11 -0500
Subject: [PATCH] - re-added jquery ui

---
 interface/lib/classes/ispcmail.inc.php |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/interface/lib/classes/ispcmail.inc.php b/interface/lib/classes/ispcmail.inc.php
index 7943c2c..c92601c 100644
--- a/interface/lib/classes/ispcmail.inc.php
+++ b/interface/lib/classes/ispcmail.inc.php
@@ -219,7 +219,7 @@
 	 *
 	 */
 	private function detectHelo() {
-		if(isset($_SERVER['HTTP_HOST'])) $this->smtp_helo = $_SERVER['HTTP_HOST'];
+		if(isset($_SERVER['HTTP_HOST'])) $this->smtp_helo = (strpos($_SERVER['HTTP_HOST'], ':') !== false ? substr($_SERVER['HTTP_HOST'], 0, strpos($_SERVER['HTTP_HOST'], ':')) : $_SERVER['HTTP_HOST']);
 		elseif(isset($_SERVER['SERVER_NAME'])) $this->smtp_helo = $_SERVER['SERVER_NAME'];
 		else $this->smtp_helo = php_uname('n');
 		if($this->smtp_helo == '') $this->smtp_helo = 'localhost';
@@ -589,9 +589,14 @@
 	 * @access private
 	 */
 	private function _smtp_login() {
-		$this->_smtp_conn = fsockopen(($this->smtp_crypt == 'ssl' ? 'ssl://' : '') . $this->smtp_host, $this->smtp_port, $errno, $errstr, 30);
+		$this->_smtp_conn = fsockopen(($this->smtp_crypt == 'ssl' ? 'tls://' : '') . $this->smtp_host, $this->smtp_port, $errno, $errstr, 30);
 		$response = fgets($this->_smtp_conn, 515);
 		if(empty($this->_smtp_conn)) return false;
+
+		//Say Hello to SMTP
+		if($this->smtp_helo == '') $this->detectHelo();
+		fputs($this->_smtp_conn, 'HELO ' . $this->smtp_helo . $this->_crlf);
+		$response = fgets($this->_smtp_conn, 515);
 
 		// ENCRYPTED?
 		if($this->smtp_crypt == 'tls') {
@@ -599,11 +604,6 @@
 			fgets($this->_smtp_conn, 515);
 			stream_socket_enable_crypto($this->_smtp_conn, true, STREAM_CRYPTO_METHOD_TLS_CLIENT);
 		}
-
-		//Say Hello to SMTP
-		if($this->smtp_helo == '') $this->detectHelo();
-		fputs($this->_smtp_conn, 'HELO ' . $this->smtp_helo . $this->_crlf);
-		$response = fgets($this->_smtp_conn, 515);
 
 		//AUTH LOGIN
 		fputs($this->_smtp_conn, 'AUTH LOGIN' . $this->_crlf);
@@ -794,7 +794,6 @@
 
 				$mail_content = 'Subject: ' . $enc_subject . $this->_crlf;
 				$mail_content .= 'To: ' . $this->getHeader('To') . $this->_crlf;
-				if($this->getHeader('Bcc') != '') $mail_content .= 'Bcc: ' . $this->_encodeHeader($this->getHeader('Bcc'), $this->mail_charset) . $this->_crlf;
 				if($this->getHeader('Cc') != '') $mail_content .= 'Cc: ' . $this->_encodeHeader($this->getHeader('Cc'), $this->mail_charset) . $this->_crlf;
 				$mail_content .= implode($this->_crlf, $headers) . $this->_crlf . ($this->_is_signed == false ? $this->_crlf : '') . $this->body;
 

--
Gitblit v1.9.1