Thunderbird and Gmail

Revision Information
  • Revision id: 250611
  • Created:
  • Creator: thomas8
  • Comment: Explain and add explicit link to "Automatic Conversion of Google mail accounts to OAuth 2.0 Authentication"
  • Reviewed: Yes
  • Reviewed:
  • Reviewed by: wsmwk
  • Is approved? Yes
  • Is current revision? No
  • Ready for localization: No
Revision Source
Revision Content

Thunderbird can be configured to work seamlessly with Google's Gmail service. Messages are synchronized between your local version of Thunderbird and the web-based Gmail.

As of May 30, 2022, Google no longer allows Less secure apps access for Gmail accounts, thus OAuth is required. If you are using Google supplied “app passwords”, Thunderbird version 91.8.0 and newer will make that conversion for you. Further, Gmail accounts do not work with Thunderbird 31 and older because they do not support Google's OAuth (implemented in bug 849540).

Configuring your Gmail account

To configure Thunderbird to work with Gmail, first enable IMAP on your Gmail account. See Gmail's instructions for help. (IMAP is enabled on new Gmail accounts by default.)

Double check that “Access for less secure apps” is enabled. See Google's article on “less secure apps” for help.

Next, select File > New > Existing Mail Account…. The Mail Account Setup dialog is displayed. After you provide your account information (real name, email address and password), Thunderbird will automatically configure your Gmail connection. Click Done, sign in with your Google account if prompted and that's all! Thunderbird will download your existing messages and your Gmail will be ready to use.

For more detailed information, please refer to:

Gmail's particularities

Archiving messages

In order to be consistent with Gmail's behavior, Thunderbird archives your message in the All Mail folder, and not in an Archive folder as it does for other accounts (as described in the Archived Messages article).

Gmail Archive settings
The Archive options… button is disabled for Gmail accounts, as it is not necessary to define the archive granularity with Gmail.

Subscribing to folders and synchronizing messages

Understanding Gmail labels and Thunderbird folders

Gmail uses a special implementation of IMAP. In this implementation, Gmail labels become Thunderbird folders. When you apply a label to a message in Gmail, Thunderbird creates a folder with the same name as the label and stores the message in that folder. Similarly, if you move a message to a folder in Thunderbird, Gmail will create a label with the folder name and assign it to the message.

In the example shown below, the folders at the same level as the [Gmail] folder (Personal, Receipts, Travel and Work) correspond to Gmail labels.

default gmail folders

There is also a set of special sub-folders for the [Gmail] folder:

  • All Mail: contains all the messages of your Gmail account, including sent and archived messages. Any messages that you see in the inbox will also appear in the [Gmail]/All Mail folder.
  • Drafts: contains draft messages.
  • Sent Mail: contains sent messages.
  • Spam: contains messages that were marked as spam (either by Gmail or Thunderbird).
  • Starred: contains messages that were starred (either by Gmail or Thunderbird).
  • Trash: contains deleted messages.
  • Important: contains messages that Gmail has flagged as “important”. (See Priority Inbox overview for more details about this Gmail feature.)

Subscribing to or unsubscribing from folders (labels)

You can configure which Gmail folders you want to display in Thunderbird. By default, all Gmail folders are displayed, as described above. To configure folder display, right-click on the account name and select Subscribe.

subscribe gmail folders

Uncheck any folders that you don't want to display in Thunderbird. Messages will still be downloaded and available through the All Mail folder. They will also be included in search results. However, the Gmail label (Thunderbird folder) will not be displayed.

Synchronizing folders (labels)

If you want to see all your Gmail labels and messages in Thunderbird but prefer to avoid all the messages being downloaded to your system, you may want to tweak the synchronization settings. This allows you to define which folder should be synchronized. If you don't synchronize a folder, the message header will still be displayed in Thunderbird, but the message content will only be downloaded when you click on the message header.

To change how messages are downloaded, set synchronization options for the account and for individual folders. (Tools > Account Settings…Edit > Account Settings…) See IMAP Synchronization for more information.

Updating Gmail account to use OAuth

Thunderbird will normally set up or update to OAuth for your Gmail account automatically. If something goes wrong, below there's some hints what to check manually. For more details and how to address various OAuth failures, please see Automatic Conversion of Google mail accounts to OAuth 2.0 Authentication.

The following applies to both POP and IMAP mail accounts.

Enable Cookies in Thunderbird.

  1. Click on the menu button The image "Fx57menu" does not exist. and click on Preferences which opens in a new tab.
  2. select Privacy & Security
  3. Under 'Web Content' section, select checkbox Accept cookies from sites

You may need to set an exception.

  1. Click on Exceptions... button.
  2. Add an exception for: https://accounts.google.com
  3. Set to Allow
  4. click on Save Changes

Change Authentication Method in Account Settings.

  1. Click on the menu button The image "Fx57menu" does not exist. (or on 'Menu Bar' use ToolsEdit) and select Account Settings which opens in a new tab.

Change the Outgoing SMTP Authentication Method:

  1. In Left Pane, select the pop/imap account name and Look bottom right for Outgoing Server (SMTP)
  2. Click on Edit Server _SMTP button
  3. Set Authentication Method : OAuth2
  4. Click on OK

Change the incoming Authentication Method:

  1. In Left Pane, select Server Settings for gmail account
  2. Set Authentication Method : OAuth2

Exit Thunderbird and wait a few moments for background processes to complete. Then Start Thunderbird.

Gmail will prompt you to enter gmail email address and normal password which is the same password you use to access gmail webmail account. Follow instructions to allow Thunderbird to access server.

An Oauth token will get saved in Thunderbird in the same location as passwords.

Useful Add-ons

  • If you want to sync your contacts between Thunderbird and Gmail, you should try either the Google Contacts or gContactSync add-ons.
  • If you want to sync your calendar between Lightning and Google Calendar, you should read Using Lightning with Google Calendar.
  • Flat Folder Tree is useful to show all the sub-folders of the [Gmail] IMAP's folder at the same level as your other folders.
  • Gmail Buttons makes it easier to move messages to the Trash and Spam folders. Beta version also shows all Gmail labels for each message.

See also