Skip to content

[Mailer] SMTP Authentication is not performed when using STARTTLS.  #34522

@crazy-weasel

Description

@crazy-weasel

Symfony version(s) affected: 4.4.0, 5.0.0

Description
Capabilities reported in EHLO after performing STARTTLS are ignored. It's possible that the AUTH-capabilitiy is only reported after the STARTTLS-command. In such situations the communication with the smtp-server would be unauthenticated, and the sending of emails would fail (in most situations).

https://github.com/symfony/symfony/blob/5.0/src/Symfony/Component/Mailer/Transport/Smtp/EsmtpTransport.php#L105

https://github.com/symfony/symfony/blob/4.3/src/Symfony/Component/Mailer/Transport/Smtp/EsmtpTransport.php#L128

How to reproduce
Use the mailer with an smpt-server (like postfix) using submission and STARTTLS.

Possible Solution
Move $capabilities = $this->getCapabilities($response); after the block which starts STARTTLS and use the response from the second EHLO-command, like it was in 4.3.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions