You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is similar to what is described on #49701.
When connecting to smtp-mail.outlook.com using STARTTLS and XOAUTH2, it attempts to first authenticate using LOGIN and then XOAUTH2. More often than not, the LOGIN authenticator times out at AbstractStream.php#L84. That exception is caught at EsmtpTransport.php#L202 and triggers a RSET. The timeout only occurs client side and the server later replies, but that difference causes the expected response $codes to get all confused.
How to reproduce
Connect to smtp-mail.outlook.com using starttls, an xoauth2 access token, and a timeout of 15s.
Possible Solution
Increase SocketStream timeout to a higher value to prevent the client side socket from timing out but that is arbitrary and doesn't fully solve the problem.
A client side connection timeout should terminate the connection rather than continue
Additional Context
Failed to authenticate on SMTP server with username "...." using the following authenticators: "LOGIN", "XOAUTH2". Authenticator "LOGIN" returned "Connection to "smtp-mail.outlook.com:587" timed out.". Authenticator "XOAUTH2" returned "Expected response code "235" but got code "250", with message "250 2.0.0 Resetting".".
…ion (bytestream)
This PR was squashed before being merged into the 6.4 branch.
Discussion
----------
Fix client side connection timeout breaks mail authentication
| Q | A
| ------------- | ---
| Branch? | 6.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | Fix#53647
| License | MIT
The authentication loop should only continue when an unexpected response has been received. Any other exception, for example, `throw new TransportException('Connection to "localhost" timed out.'));` should be treated as fatal and thrown.
As demonstrated in #53647, when anything other than a server response is skipped it results in later commands not matching their expected response codes.
Commits
-------
bb2e7fd Fix client side connection timeout breaks mail authentication
This PR was squashed before being merged into the 7.1 branch.
Discussion
----------
[Mailer] Add timestamp to SMTP debug log
| Q | A
| ------------- | ---
| Branch? | 7.1
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Issues |
| License | MIT
When debugging #53647, the lack of a timestamp made it difficult to understand why the `RSET` was happening before a response had been received. The timestamps gave a clue towards the problem. The timestamps also help show slow connections which you're otherwise not aware of.
Commits
-------
53a637c [Mailer] Add timestamp to SMTP debug log
Symfony version(s) affected
6.4.2
Description
This issue is similar to what is described on #49701.
When connecting to
smtp-mail.outlook.com
usingSTARTTLS
andXOAUTH2
, it attempts to first authenticate usingLOGIN
and thenXOAUTH2
. More often than not, theLOGIN
authenticator times out at AbstractStream.php#L84. That exception is caught at EsmtpTransport.php#L202 and triggers aRSET
. The timeout only occurs client side and the server later replies, but that difference causes the expected response$codes
to get all confused.How to reproduce
Connect to smtp-mail.outlook.com using starttls, an xoauth2 access token, and a timeout of 15s.
Possible Solution
SocketStream
timeout to a higher value to prevent the client side socket from timing out but that is arbitrary and doesn't fully solve the problem.Additional Context
Failed to authenticate on SMTP server with username "...." using the following authenticators: "LOGIN", "XOAUTH2". Authenticator "LOGIN" returned "Connection to "smtp-mail.outlook.com:587" timed out.". Authenticator "XOAUTH2" returned "Expected response code "235" but got code "250", with message "250 2.0.0 Resetting".".
The text was updated successfully, but these errors were encountered: