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:
- 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.
- 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.
- 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:
- Go to the config editor (Preferences -> Advanced -> Config Editor)
- 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".
- Change the offending username to contain the full email address.
- 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 :)