Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Mailer] Force disable STARTTLS #49114

Closed
@filippovano

Description

@filippovano

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions