-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Mailer] [Smtp] Add DSN param 'auto_tls' to disable automatic STARTTLS #53621
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I think this is a valid and working approach. |
Using simple But I'm not attached to this name so it can be changed. |
Indeed. If there were a setting called |
In #52944, there is a need to be able to disable TLS while using smtp on port 465. |
2c60e1c
to
59a6796
Compare
59a6796
to
189a1ac
Compare
Thank you @srsbiz. |
/cc @aslangery |
What about versions >5.4? |
That's a new feature so you should upgrade. |
…(ssddanbrown) This PR was merged into the 7.3 branch. Discussion ---------- [Mailer] [Smtp] Add DSN param to enforce TLS/STARTTLS | Q | A | ------------- | --- | Branch? | 7.3 | Bug fix? | no | New feature? | yes | Deprecations? | no | Issues | Fix #48297 | License | MIT Adds 'require_tls' param which can be set to true to enforce the use of TLS/STARTTLS within the ESMTP transport. This was discussed in #48297. These changes are based upon patches [I've been maintaining](ssddanbrown/symfony-mailer@e9de8dc) for my own projects. This is my first PR to Symfony, I've tried to follow the guide as best as possible, and I was also using #53621 as a general guide. There are some other ways I could have gone about things, but I've tried to avoid touching as much existing Symfony code as possible. In #48297, nicolas-grekas mentioned unifying such an option with `auto_tls` under a `tls` option, but I think these are distinct options which may not be as clear combined (in addition to any expectations of such an option disabling/enabling TLS in general). Commits ------- a93d5f6 [Mailer] [Smtp] Add DSN param to enforce TLS/STARTTLS
Many times we don't have any jurisdiction over configuration of SMTP server we are trying to connect to. If such server claims to be capable of STARTTLS, but drops connection after sending this command, there was no way to prevent mailer from sending it - despite defining protocol as
stmp
and port25
.Now adding
auto_tls=false
to DSN we can prevent transport to automatically send STARTTLS when we do not intend to use TLS.