-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Mailer] Option to enforce STARTTLS #48297
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
Comments
This sounds a lot like MTA-STS. |
The RFC says I'm working on a hotel management software, where each hotel can specify SMTP recipient server for mailing their hotel emails and I'd like to make it more secure for cases when port 587 is used or when hotel staff knows that the recipient server port supports STARTTLS. The alternative is to use port 465 (implicit SSL/TLS), but not all recipient servers support TLS on that port (some only SSL, which is outdated). |
Thank you for this suggestion. |
I would like to see this feature. In my use-case, I have an open source application with configurable SMTP details, so it's used with many different mail services. I tried to extend the existing Esmtp transport but I could not find a clean way of doing this. I'd be happy to work on and provide a PR for this. @Swanty Would it work for you if the option enforces either STARTTLS or TLS? Or do you need specific indication of STARTTLS usage (so fail if TLS is used instead)? |
Yes, your patch works great for my use case - thank you 🙏 |
fixed in #53621 |
#53621 paved the way to show how this should be done. Could be by renaming auto_tls to just tls and support bool|auto as a value. |
Thank you for this suggestion. |
Could I get an answer? If I do not hear anything I will assume this issue is resolved or abandoned. Please get back to me <3 |
Hey, I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen! |
It's somewhat sad to see that this was closed automatically. Being able to make sure a SMTP session uses TLS would be very useful, especially regarding Art. 25 GDPR |
The thing is, if nobody builds a certain feature, we just won't have it. The auto-close of the ticket does not mean that it's a won't fix. We would still accept a PR that delivers the feature. If you believe that this feature is useful, or even better, you actually need it, you would be in the best position to build it. |
I've started a PR for this at #59479 |
…(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
Description
That line will be
true
only if server reports that it hasSTARTTLS
support, but during a man-in-the-middle attack one could remove this capability and communication would happen in cleartext.It would be great if there was an option to enforce
STARTTLS
🙏Example
No response
The text was updated successfully, but these errors were encountered: