Open Bug 2048831 Opened 5 months ago Updated 4 days ago

Thunderbird fails to detect Gmail Trash folder upon account setup - when user Gmail language is set to English (UK)

Categories

(Thunderbird :: Folder and Message Lists, defect)

Thunderbird 151
defect

Tracking

(Not tracked)

ASSIGNED

People

(Reporter: roy-orbison, Assigned: mkmelin)

References

(Depends on 1 open bug)

Details

Attachments

(1 file, 2 external files)

I've noticed this when setting up multiple new accounts on Windows and Linux. The Deleted folder is not found, so normal message delete actions fail. The folder is visible but presents as if it's a user-created folder/label. My only guess is because the Gmail interface language (under General) is set to English (UK) not English (US). The location Tb sees (as shown in the folder properties dialogue) is like so:

imap://user%40domain.example@imap.gmail.com/[Gmail]/Bin

It's necessary to install the Folder Flags add-on and modify it from that same dialogue, to obtain the correct behaviour. This changes the label from Bin to Deleted, and the icon from the generic to the special.

From what I've searched, this bug is distinct from other apparently similar ones because the folder has not been otherwise customised in any way, is exposed to IMAP, subscribed to, and visible to the user. No special behaviour is desired, and all accounts follow the Gmail Tb recommendations.

The folder is visible but presents as if it's a user-created folder/label.

You do not mention if you did the following first.

  • In 'Account Settings' > 'Server Settings' for the gmail imap account
  • When I delete a message:
  • Select 'Move it to this folder: select 'Bin on gmail account name'

It applies the correct flag.
The 'Bin' folder has the bin icon in the Folder Pane.

This works for me - I have imap gmail account, see 'Bin' and use English (UK)

Right click on Bin folder and select Properties
It says:

Flags: needinfo?(roy-orbison)

It occurred before any such settings had been touched. The Gmail accounts (provided by Google Workspace) were added via the default point-and-click wizard, not manually. Afaik, it's not possible to alter those settings until after Tb has added the account, and subscribed to the folders, unless one switches to manual configuration, and I didn't.

I've just tried it again in a fresh profile, with a (very much) older personal Gmail account, on Linux and it detected the folder. It had a location like:

imap://user%40gmail.com@imap.gmail.com/Trash

Similar to yours, it lacks the [Gmail] subfolder that the Workspace accounts have. The affected Workspace accounts were only created this year. I wonder if the account age affects how it is exposed via IMAP.

(In reply to Anje from comment #1)

You do not mention if you did the following first.

I kind of mentioned it indirectly, as following Gmail's recommended settings means use "just mark as deleted". Regardless, no account had further settings applied until after Tb was showing the 3-pane window containing undecorated Bin folders. Forcing the flag on each account, using that add-on was the only thing that corrected it.

Flags: needinfo?(roy-orbison)

How is v152?

Summary: Thunderbird fails to detect Gmail Trash folder upon account setup → Thunderbird fails to detect Gmail Trash folder upon account setup - when user Gmail language is set to English (UK)

I was incorrect about the second test, I did the same again to verify, brand new profile, no add-ons used, no settings changed at all other than adding mail account via wizard. First test was in v153, this one was in v151. Tb just created a folder named Trash and gave it the special flag, but it was not the real Trash. When I deleted messages by moving to that visible Trash folder, it added the custom label "[Imap]/Trash" in the Android and web apps. When checking the folder subscriptions, which I did not change, it was clear what had happened.

I have not had access to the Windows machines where I noticed the detection failure occur repeatedly. I will try when I have the chance.

Confirming base on the report from Matrix.

Status: UNCONFIRMED → NEW
Ever confirmed: true

Thunderbird only applied mailbox flags to folders returned by LSUB, so a
\Trash special-use folder the user isn't subscribed to was never recognised,
and a folder named like the default "Trash" could take the role instead. On a
Gmail account whose interface language is English (UK), where the trash folder
is "[Google Mail]/Bin", that meant Thunderbird created a "Trash" folder on the
server, treated it as the trash folder, and could never change its mind, so
deleting messages failed.

Folder discovery now LISTs the folder the server reports as \Trash when it
hasn't turned up by itself, and settles which folder is the trash folder in one
place, shared with the delete model setting: the folder the user picked, or
failing that the one the server reports, or failing that one matching the
default path, and none at all for a delete model that doesn't use a trash
folder.

The trash folder path pref is now only written when the user picks a folder,
which makes it the one reliable sign of a deliberate choice: a picked folder is
always the trash folder, whatever the server says. Where the path was needed,
the folder flagged as trash is used instead, the account settings folder picker
shows that folder, and a migration clears the paths older versions wrote so
affected accounts recover.

Unlike the other special use flags, the trash folder flag is no longer locked
against removal, since the account decides whether the folder the server calls
its trash folder is in use as such. What the server said isn't forgotten, as
the mailbox flag it was set from is what finds the folder again.

Assignee: nobody → mkmelin+mozilla
Status: NEW → ASSIGNED
See Also: → 2073924
Duplicate of this bug: 2079644
See Also: → 2085365

Shift-deleting on Gmail copies the messages to the trash folder and expunges
them there, addressing the folder by the configured trash folder path. That
path is only set when the user picks a folder, so with the folder the server
reports as \Trash the copy went to a mailbox that doesn't exist and the
messages were only marked deleted.

Folder discovery now leaves the mailbox name of the folder in use as trash in
the host session list, which the imap thread can read, since it can't look at
folders itself.

(Not covered by a test: the fake server's Gmail configuration answers BAD to
UID COPY, UID STORE and UID EXPUNGE.)

Depends on: 2098130
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: