Symfony/mailer v6.4.3 + gmail SMTP issues

Created on 5 February 2024, 10 months ago
Updated 8 August 2024, 4 months ago

This appears to be an issue with symfony/mailer and not this module per se, but I wanted to post this here in case it can help anyone else.

I updated Drupal Commerce from 2.3.6 to 2.3.7, and in the background, that triggered an update of symfony/mailer from v6.4.0 to v6.4.3.

Once I pushed out that update, I could no longer send any email via SMTP to Google/Gmail. I tried for hours to find the issue, changing my app password and verifying all my settings, DKIM, etc.

I was able to verify via a separate environment that I could still authenticate and send emails with exactly the same credentials as long as symfony/mailer hadn't been updated to v6.4.3

Here's an example of the error message I would receive anytime an email send was attempted:

Error sending email: Failed to authenticate on SMTP server with username "myemail@mydomain.com" using the following authenticators: "LOGIN", "PLAIN", "XOAUTH2". Authenticator "LOGIN" returned "Expected response code "235" but got code "535", with message "535-5.7.8 Username and Password not accepted. For more information, go to 535 5.7.8 https://support.google.com/mail/?p=BadCredentials g17-20020a05620a40d100b007831f8c5aeasm119457qko.55 - gsmtp".". Authenticator "PLAIN" returned "Expected response code "235" but got code "535", with message "535-5.7.8 Username and Password not accepted. For more information, go to 535 5.7.8 https://support.google.com/mail/?p=BadCredentials g17-20020a05620a40d100b007831f8c5aeasm119457qko.55 - gsmtp".". Authenticator "XOAUTH2" returned "Expected response code "235" but got code "334", with message "334 eyJzdGF0dXMiOiI0MDAiLCJzY2hlbWVzIjoiQmVhcmVyIiwic2NvcGUiOiJodHRwczovL21haWwuZ29vZ2xlLmNvbS8ifQ==".".

So in the end, when I rolled back symfony/mailer to v6.4.0 I was able to authenticate via SMTP and send emails again.

composer require 'symfony/mailer:6.4.0'

Again, just wanted to share my findings in case anyone else is having the same issue.

πŸ“Œ Task
Status

Active

Version

1.4

Component

Documentation

Created by

πŸ‡ΊπŸ‡ΈUnited States bradhawkins

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024