From 226c907e35653f324f923d96d2ac7282c5111fe7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 1 Jul 2020 17:00:52 +0200 Subject: [PATCH] FIX Use of office365 TLS with SMTPs method. --- htdocs/core/class/smtps.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index 0a0a39cc7cb..87ce3c22e80 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -424,7 +424,7 @@ class SMTPs $host = preg_replace('@ssl://@i', '', $host); // Remove prefix $host = preg_replace('@tls://@i', '', $host); // Remove prefix - if ($usetls) $host = 'tls://'.$host; + if ($usetls && ! empty($conf->global->MAIN_SMTPS_ADD_TLS_TO_HOST_FOR_HELO)) $host = 'tls://'.$host; $hosth = $host; @@ -558,6 +558,8 @@ class SMTPs $host = preg_replace('@ssl://@i', '', $host); // Remove prefix $host = preg_replace('@tls://@i', '', $host); // Remove prefix + if ($usetls && ! empty($conf->global->MAIN_SMTPS_ADD_TLS_TO_HOST_FOR_HELO)) $host = 'tls://'.$host; + $hosth = $host; if (!empty($conf->global->MAIL_SMTP_USE_FROM_FOR_HELO))