From b5818b931f04d91350fd5f684ac9a811f53369b6 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 4 Apr 2014 08:31:28 +0000 Subject: [PATCH] patched PHPMailer to allow to use STARTTLS and TLS version>=1, enhanced wizard to autodetect hosted 1-and-1 domains by using Mozilla ISPDB on MX or domain-part of MX, fixed folder detection to not require folders below INBOX --- phpgwapi/inc/class.phpmailer.inc.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/phpgwapi/inc/class.phpmailer.inc.php b/phpgwapi/inc/class.phpmailer.inc.php index ad4d51e5f0..a9ef694b09 100644 --- a/phpgwapi/inc/class.phpmailer.inc.php +++ b/phpgwapi/inc/class.phpmailer.inc.php @@ -864,15 +864,26 @@ class PHPMailer { $port = $this->Port; } $hostA = explode("://", $host); - if (strtolower($hostA[0]) == 'tls' || strtolower($hostA[0]) == 'ssl') { + if (in_array(strtolower($hostA[0]), array('tls', 'ssl', 'tlsv1'))) { $this->SMTPSecure = strtolower($hostA[0]); $host = $hostA[1]; } - $tls = ($this->SMTPSecure == 'tls'); - $ssl = ($this->SMTPSecure == 'ssl'); + $tls = ($this->SMTPSecure == 'tls'); // starttls + switch($this->SMTPSecure) + { + case 'tls': // STARTTLS + $tls = true; + break; + case 'ssl': + $host = 'ssl://'.$host; + break; + case 'tlsv1': // require minimum tls version 1.0, no more ssl 2 or 3 + $host = 'tls://'.$host; + break; + } - if ($this->smtp->Connect(($ssl ? 'ssl://':'').$host, $port, $this->Timeout)) { + if ($this->smtp->Connect($host, $port, $this->Timeout)) { $hello = ($this->Helo != '' ? $this->Helo : $this->ServerHostname()); $this->smtp->Hello($hello);