Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nicolas-grekas merged 1 commit intosymfony:7.1fromsrsbiz:mailer-disable-autotls
Jan 30, 2024

Conversation

srsbiz
Copy link
Contributor

QA
Branch?7.1
Bug fix?no
New feature?yes
Deprecations?no
IssuesFix#49114
LicenseMIT

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 asstmp and port25.

Now addingauto_tls=false to DSN we can prevent transport to automatically send STARTTLS when we do not intend to use TLS.

OskarStark reacted with thumbs up emoji
@carsonbotcarsonbot added this to the7.1 milestoneJan 23, 2024
@carsonbotcarsonbot changed the title[Mailer][Smtp] Add DSN param 'auto_tls' to disable automatic STARTTLS[Mailer] [Smtp] Add DSN param 'auto_tls' to disable automatic STARTTLSJan 23, 2024
@nicolas-grekas
Copy link
Member

I think this is a valid and working approach.
I'm just wondering about the naming :)
What about justtls instead ofauto_tls?

@srsbiz
Copy link
ContributorAuthor

Using simpletls might create confusion when usingsmptps or port465 that should enable TLS by default. So it would require more checks and warnings about param having no effect, but addingauto_ IMHO suggest that it appliest to automatic TLS detection.

But I'm not attached to this name so it can be changed.

@derrabus
Copy link
Member

Using simpletls might create confusion when usingsmptps or port465 that should enable TLS by default.

Indeed. If there were a setting calledtls, my expectation would be that I either get a TLS connection or no connection at all. However, theSTARTTLS feature is about plaintext connections thatmight be upgraded to TLS (opportunistic TLS).auto_tls is a better fit.

OskarStark reacted with thumbs up emoji

@nicolas-grekas
Copy link
Member

nicolas-grekas commentedJan 29, 2024
edited
Loading

In#52944, there is a need to be able to disable TLS while using smtp on port 465.
What about supportingtls=auto|bool here to support this use case and yours?

@srsbizsrsbizforce-pushed themailer-disable-autotls branch from2c60e1c to59a6796CompareJanuary 29, 2024 23:30
@nicolas-grekas
Copy link
Member

Thank you@srsbiz.

@nicolas-grekas
Copy link
Member

/cc@aslangery
Symfony 7.1 will allow using stmp on port 465 by adding auto_tls=false to the DSN.

@aslangery
Copy link

What about versions >5.4?

@nicolas-grekas
Copy link
Member

That's a new feature so you should upgrade.

derrabus and mvhirsch reacted with thumbs up emoji

@fabpotfabpot mentioned this pull requestMay 2, 2024
nicolas-grekas added a commit that referenced this pull requestFeb 11, 2025
…(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       | MITAdds '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
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
7.1
Development

Successfully merging this pull request may close these issues.

[Mailer] Force disable STARTTLS
5 participants
@srsbiz@nicolas-grekas@derrabus@aslangery@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp