Hello osTicket Support Team,
We are in the process of configuring Gmail SMTP with OAuth2 in osTicket v1.18.2 (53339df) and have run into an issue we’re hoping to get help with.
Configuration Details:

OAuth2 Setup: Completed in Google Cloud Console (Client ID, Secret, scopes, etc.)

Authorization: Succeeds during the OAuth2 flow and returns "Authorization Successful"
However, when we attempt to save the email settings after this successful authorization, the system throws the following error message:
eyJzdGF0dXMiOiI0MDAiLCJzY2hlbWVzIjoiQmVhcmVyIiwic2NvcGUiOiJodHRwczovL21haWwuZ29vZ2xlLmNvbS8ifQ==
What We've Verified:
The client has Gmail API and OAuth2.0 Client IDs properly set in Google Cloud Console.
Scopes configured include: https://mail.google.com/
OAuth2 flow completes correctly – token is retrieved and stored.
SMTP configuration uses:
Host: smtp.gmail.com
Port: 587
Encryption: TLS
The error only occurs when saving settings in osTicket, not during the OAuth2 flow.
Decoding the Error:
When base64-decoding the message:
{
"status": "400",
"schemes": "Bearer",
"scope": "https://mail.google.com/"
}
This suggests a 400 Bad Request is being returned by Gmail’s SMTP endpoint when osTicket tries to validate or send via SMTP.
Possible Cause (Needs Clarification):
We suspect that:
The access token may not be properly applied in the SMTP authentication layer.
osTicket might not be fully sending the AUTH XOAUTH2 command as expected by Gmail SMTP, or the format could be incorrect.
Or, Gmail is rejecting the token for a specific reason (like missing/incorrect scopes, or token expiry).
Could someone from the osTicket team or community help us with the following:
- Clarify if osTicket currently fully supports Gmail SMTP with OAuth2 (XOAUTH2) – especially with TLS on port 587.
-
- Confirm what scope(s) are strictly required for Gmail SMTP to work with OAuth2 in osTicket.
-
- Help diagnose if there’s a bug in how osTicket formats or sends the access token during the SMTP AUTH command.
Additional Info:

Environment: Windows
We appreciate any guidance or troubleshooting steps you can provide!