Thunderbird fails gmail OAuth2 despite correct credentials

5,130

Solution 1

Solution suggested in this thread solved my problem.

It seems, that gmail fails authentication when it detects useragent of inbuilt thunderbird browser. The solution is to set"general.useragent.compatMode.firefox" property to true. This is done with config editor (Edit-Preferences-Advanced-General-Config Editor.)

Solution 2

For me, no other suggestions worked, but https://support.mozilla.org/xh/questions/1183589 put me on the right path (although not exactly my situation).

Try my suggestion if the following applies:

  1. You've selected Oauth2 as the authentication scheme and tried logging in with Oauth2. You still get the error message. Removing passwords has allowed you to log in again, but the problem persists.
  2. When you show the saved passwords (Preferences -> Security -> Saved passwords), it lists your username as "myaccount" instead of "[email protected]" - it does not show the full email address.
  3. If you manually edit the username (right click -> Edit Username), Thunderbird will prompt you to login again. If you do so, it adds a new entry to the list, with the username "myaccount" instead of "[email protected]".

NOTE: This was the last thing I tried after a wide range of failed attempts at following suggestions - so I'd already tried everything from enabling IMAP in gmail to removing saved passwords to editing the configurations and setting the general.useragent.compatMode.firefox property. Those changes may be enough to solve your problem, or they may be necessary but not sufficient requirements for my solution to work.

Solution:

  1. Go to the config editor (Preferences -> Advanced -> Config Editor)
  2. Search for "username" - this should bring up a few results, one or more of which may have the value "myaccount" instead of "[email protected]". For me, this was "mail.server.server1.userName".
  3. Change the offending username to contain the full email address.
  4. If necessary, delete your passwords and log in again using Oauth2.

If you've tried everything else with no luck, hopefully this finally does it :)

Share:
5,130

Related videos on Youtube

Feldmarshall
Author by

Feldmarshall

Updated on September 18, 2022

Comments

  • Feldmarshall
    Feldmarshall almost 2 years

    When trying to set up Gmail account using OAuth2 on fresh Thundirbird install I can't get properly authenticated despite providing correct credentials.

    With help of the Thunderbird wizard I get all the servers and a new window for OAuth2 is displayed. I log in and two 2 step authentication after which I'm presented with information that I'm about to allow thunderbird to receive, send email etc.

    After I click allow the thunderbird displays "Authentication failure while connecting to server imap.gmail.com".

    • Thufir
      Thufir over 4 years
      This is the only actual solution which gives anything close to a "reason", other supposed "answers" simply involve uninstalling Thunderbird. It's not a version problem at all.
  • Thufir
    Thufir over 4 years
    Correct. Only correct answer I found, re-installing Thunderbird isn't required.
  • DavidPostill
    DavidPostill about 4 years
    Welcome to Super User! Please quote the essential parts of the answer from the reference link(s), as the answer can become invalid if the linked page(s) change.
  • Mike Smith
    Mike Smith about 4 years
    You may need to delete old passwords in Thunderbird when updating the passwords in Gmail... It is a bit hard to find where those passwords are stored though so you need to watch the video that shows exactly how / where the passwords are stored... As per previous: This was a very unique issue when you have had multiple password updates in Gmail and Thunderbird is storing the old passwords that are conflicting with your new password which may be inhibiting you from entering your new password into Thunderbird.