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))