SysTutorials

Gmail SMTP Setup in Thunderbird Using OAuth2

· updated May 17, 2026

Gmail requires OAuth2 authentication for SMTP access — direct passwords have been disabled entirely. This is the only supported method for sending mail through Gmail in Thunderbird, whether you’re using a personal or Workspace account.

OAuth2 Setup

Open Thunderbird and go to Account Settings → Outgoing Server (SMTP). Click Add and configure these settings:

When you click OK, Thunderbird launches a browser window asking you to sign in with your Google account and grant mail-sending permissions. Your actual password never enters Thunderbird — OAuth2 exchanges it for a limited, revocable token instead.

Why OAuth2 Matters

This approach beats password authentication in several ways:

Google Workspace Considerations

For Workspace accounts (user@company.com), the SMTP settings are identical, but additional restrictions may apply:

Troubleshooting Common Problems

Authentication failed when sending

Thunderbird may have cached stale credentials. Delete the Gmail account entirely (Account Settings → Account Actions → Delete Account), restart Thunderbird, and re-add it. This forces a fresh OAuth2 authorization.

Failed to initialize OAuth2 during authorization

Verify you’re using your complete Gmail address including @gmail.com. For Workspace accounts, confirm with your admin that third-party SMTP access is enabled.

Authorization window doesn’t appear

Check for network restrictions blocking the connection:

Invalid credentials despite correct settings

OAuth2 tokens expire after extended inactivity. Delete the account and re-authorize. If this happens frequently, ensure Thunderbird is configured to sync on a reasonable schedule (not disabled entirely).

Wrong port or connection type errors

STARTTLS requires port 587. Port 465 uses implicit TLS and won’t work with STARTTLS. Verify your firewall allows outbound connections on port 587: telnet smtp.gmail.com 587 (expect a 220 response).

App Passwords as a Last Resort

If OAuth2 won’t work despite troubleshooting, use an app password (less secure, but functional):

  1. Visit myaccount.google.com → Security
  2. Enable 2-Step Verification if not already active
  3. Scroll to App passwords
  4. Select Mail and Linux (or your device type)
  5. Google generates a 16-character password
  6. In Thunderbird, set Authentication method to Normal password and paste this generated password

This works but bypasses OAuth2’s security benefits. Use it only when OAuth2 fails after troubleshooting.

Enable Debug Logging

To diagnose persistent issues:

  1. Go to Help → Troubleshooting Information
  2. Scroll to Logging and enable debug mode for SMTP
  3. Restart Thunderbird and attempt to send
  4. Check the generated logs for specific error messages

The logs typically reveal token expiration, DNS resolution failures, firewall blocks, or authentication timeouts that aren’t obvious from user-facing errors.

Verify the Configuration

Send a test email to confirm everything works. Once OAuth2 is functioning, it requires no further adjustment unless you change Gmail’s security settings or explicitly revoke Thunderbird’s access through your Google Account security settings page.

← All posts