Email DSN with Workspace, failing with credentials warnings

Your software
My Mautic version is: 5.0.3
My PHP version is: 8.0.30
My Database type and version is: MariaDB 10.x

Your problem
My problem is: Switched to Google Workspace for our email provider and now due to them not supporting less secure apps I can no longer setup or connect SMTP or IMAP to Mautic. I tried switching on 2fa in workspace and then adding an app password and trying to use this as my settings but it still fails to send the test email with differing connection errors

These will usually be around bad credentials. Even though the credentials are correct.

These errors are showing in the log:

Failed to authenticate on SMTP server with username “info@” 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 Can't sign in to your Google Account - Gmail Help ix12-20020a170902f80c00b001e2bdefa3a9sm6713986plb.64 - 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 Can't sign in to your Google Account - Gmail Help ix12-20020a170902f80c00b001e2bdefa3a9sm6713986plb.64 - gsmtp”.”. Authenticator “XOAUTH2” returned “Expected response code “235” but got code “334”, with message “334 eyJzdGF0dXMiOiI0MDAiLCJzY2hlbWVzIjoiQmVhcmVyIiwic2NvcGUiOiJodHRwczovL21haWwuZ29vZ2xlLmNvbS8ifQ==”.”.

Steps I have tried to fix the problem:

  • Setup 2fa in google workspace

  • Created an App Password

  • Tested with App Password

  • Attempted to setup using the gmail transport method

  • Changed password, disabled 2fa and used raw password

  • Using the App credentials work fine for the inbox monitoring settings but do not work for the DSN

Anyone had any success in setting this up?

Thanks


Do not disable 2FA, App password will only work with 2FA enabled

Correct. I have kept it on. Whatbi was saying is it tried switching off 2fa and using just a password but that also failed.

For clarity with 2fa on and using an app password the dsn fails

With 2fa off and using the account password thr dsn fails

Has anyone else got any thoughts or ideas here. I appreciate Nezam trying to answer with something but its completely not helpful.

  • I have tried app password with 2fa on
  • I have tried ap password with 2fa off
  • I have tried account password with 2fa off
  • I have tried account password with 2fa on

All of them fail with authentication errors

In mautic 5.0.3 there is no option to “Sign in with Google” otherwise that would work as it does with my other tools.

Would love any help anyone can give, because even as a technical person I cant get this going. I even install gmail through composer for the mailer and this still ends up with the same issues