From 92a36dbeee93b6387bd32394b83e10e08f22e5df 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 51e375c5279..09a1f7f2949 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -428,7 +428,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; @@ -565,6 +565,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))