From ead19d00068fc1a6f22431cf3e71bc452dbc4248 Mon Sep 17 00:00:00 2001 From: Radoslaw Kowalewski Date: Tue, 30 Jan 2024 20:36:30 +0100 Subject: [PATCH] [Mailer][Smtp] Document 'auto_tls' param --- mailer.rst | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/mailer.rst b/mailer.rst index 07f341cf508..cf17a55a6e2 100644 --- a/mailer.rst +++ b/mailer.rst @@ -347,6 +347,30 @@ may be specified as SHA1 or MD5 hash:: $dsn = 'smtp://user:pass@smtp.example.com?peer_fingerprint=6A1CF3B08D175A284C30BC10DE19162307C7286E'; +Disabling automatic TLS +~~~~~~~~~~~~~~~~~~~~~~~ + +.. versionadded:: 7.1 + + Disabling automatic TLS was introduced in Symfony 7.1. + +By default, mailer will check if OpenSSL extension is enabled and if SMTP server +is capable of STARTTLS, it will issue this command to enable encryption on stream. +This behavior can be turned off by calling ``setAutoTls(false)`` on ``EsmtpTransport`` +instance, or by setting ``auto_tls`` option in DSN:: + + $dsn = 'smtp://user:pass@10.0.0.25?auto_tls=false'; + +.. caution:: + + It's not recommended to disable TLS while connecting to SMTP server over + internet, but it can be useful when both application and SMTP server are in + secured network, where there is no need for additional encryption. + +.. note:: + + This setting works only when ``smtp://`` protocol is used. + Overriding default SMTP authenticators ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~