The Wayback Machine - https://web.archive.org/web/20230213202501/https://github.com/symfony/symfony/issues/49114
Skip to content
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

[Mailer] Force disable STARTTLS #49114

Open
filippovano opened this issue Jan 26, 2023 · 2 comments
Open

[Mailer] Force disable STARTTLS #49114

filippovano opened this issue Jan 26, 2023 · 2 comments
Labels

Comments

@filippovano
Copy link

Description

I have an SMTP server that sits between my application and other external systems. Communication between my application and the server does not use any encryption. Encryption is used when the server communicates with external systems.

I need to send an email from my app to a server without any encryption. When I use the symfony/mailer the application sends an ECHO request and my server tells me that it is using STARTTLS. I have to send STARTTLS and my server says it doesn't support encryption for my host.

It all happens because of this line:

// https://github.com/symfony/mailer/blob/6.1/Transport/Smtp/EsmtpTransport.php#L136

if (!$stream->isTLS() && \defined('OPENSSL_VERSION_NUMBER') && \array_key_exists('STARTTLS', $this->capabilities)) {

I know for sure that I don't need to use any encryption regardless of whether the STARTTLS server sends me. But I can't disable STARTTLS in any way, because there is no setting (for ex. disable_starttls) in the configs.

I think it makes sense to add this setting, it will make the package more flexible.

Example

No response

@filippovano filippovano changed the title Force disable STARTTLS [Mailer] Force disable STARTTLS Jan 26, 2023
@stof
Copy link
Member

stof commented Jan 26, 2023

Well, if your SMTP server does not support STARTTLS, why would it advocate STARTTLS in its capabilities ? That's expliictly against the spec.

The symfony/mailer component will use STARTTLS only if the SMTP server advocates that it supports it (and we are not already using a TLS connection to that server as double encryption would be useless).

@derrabus
Copy link
Member

We've had similar issues with maildev and decided to not fix this on Symfony's side, see #34242.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.