Repository navigation
FOUR-33829 | Google OAuth Email Configuration Intermittently Failing - #9102
Conversation
OAuth mail transports now force XOAUTH2 authentication for Gmail and Office365, preventing SMTP sessions from being poisoned by LOGIN/PLAIN fallback. Standard mail auth keeps the default authenticator set. This change also adds unit coverage to verify the OAuth-specific authenticator configuration.
PR SummaryMedium Risk Overview In Adds Reviewed by Cursor Bugbot for commit 2b8061a. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
eiresendez
left a comment
There was a problem hiding this comment.
- The external PHPMailer evidence shows that the same OAuth account works when authentication is explicitly restricted to XOAUTH2.
- The patch addresses that exact difference.
- The restriction applies only to Google and Office 365 OAuth. Standard SMTP behavior is unchanged.
- The implementation is small, correctly scoped, and aligned with the ticket 👍
|
QA server K8S was successfully deployed https://tenant-1.ci-4a5ce34c6b.engk8s.processmaker.net |





Issue
Ticket: FOUR-33829
Google and Office 365 OAuth email configuration in Admin → Settings could fail when sending a test message or when the application sends mail. The SMTP error showed LOGIN and PLAIN attempted before XOAUTH2, with LOGIN returning
535 BadCredentialsand XOAUTH2 returning an empty response.After the Swift Mailer to Symfony Mailer migration, OAuth SMTP no longer forced XOAUTH2. Symfony’s default order tries LOGIN and PLAIN first while the transport password is an OAuth access token, not the mailbox password. That mismatch fails against Google (and the same pattern applies to Office 365 SMTP OAuth). Behavior could look intermittent when the server still tolerated a fallback to XOAUTH2.
Solution
processmaker
OauthMailManager, whenmail.auth_methodisgoogleoroffice365, restrict the SMTP transport to the SymfonyXOAuth2Authenticatorbefore setting the From address as username and the access token as passwordsetAuthMode('XOAUTH2')behavior using Symfony’ssetAuthenticators()APIstandardauth still keeps Symfony’s default authenticators (LOGIN, PLAIN, XOAUTH2, etc.)How To Test
Automated Tests
phpunit tests/unit/ProcessMaker/Managers/OauthMailManagerTest.phpManual Tests
ci:deploy
Code Review Checklist