From 444e616f6b264b1bcae3078896e8e4b326d7af44 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 23 Apr 2020 14:38:20 +0200 Subject: [PATCH] [Mailer] Add a comment to avoid more wrong PRs on this piece of code --- src/Symfony/Component/Mailer/Transport/Smtp/EsmtpTransport.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Symfony/Component/Mailer/Transport/Smtp/EsmtpTransport.php b/src/Symfony/Component/Mailer/Transport/Smtp/EsmtpTransport.php index 3f68227ba419..afa522ae97e1 100644 --- a/src/Symfony/Component/Mailer/Transport/Smtp/EsmtpTransport.php +++ b/src/Symfony/Component/Mailer/Transport/Smtp/EsmtpTransport.php @@ -106,6 +106,9 @@ protected function doHeloCommand(): void /** @var SocketStream $stream */ $stream = $this->getStream(); + // WARNING: !$stream->isTLS() is right, 100% sure :) + // if you think that the ! should be removed, read the code again + // if doing so "fixes" your issue then it probably means your SMTP server behaves incorrectly or is wrongly configured if (!$stream->isTLS() && \defined('OPENSSL_VERSION_NUMBER') && \array_key_exists('STARTTLS', $capabilities)) { $this->executeCommand("STARTTLS\r\n", [220]);