Open Bug 1817707 Opened 3 years ago Updated 1 year ago

deleting folder unsubscribes all other folders [caused by icloud producing incorrect <tag> lsub "" "foldName/*" responses]

Categories

(Thunderbird :: Folder and Message Lists, defect)

Thunderbird 102
Desktop
Linux
defect

Tracking

(Not tracked)

ASSIGNED

People

(Reporter: jdien07, Assigned: gds)

References

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/109.0

Steps to reproduce:

Thunderbird 102.7.1 under Pop!_OS 22.04 LTS. My email provide is Apple's IMAP iCloud service. I am trying to migrate from OS X to Linux. I first tried Thunderbird three (?) years ago on this computer but gave up, meanwhile Thunderbird continued to be updated to the current release. I tried again this week and was impressed with progress. However, several folders were missing. They were still there when viewed using OS X Mail and Linux Evolution. I used the Troubleshooting Information function to look at the Profile directory and the corresponding files were indeed missing.

Following some online suggestions, I tried New Folder with the name of the missing folder several times but the folder did not appear in the list, without any error message. I then tried to delete an unneeded folder and it successfully deleted (on both Thunderbird and OS X Mail) but ALL the folders disappeared except Inbox and Trash! Panic! But they were still there on OS X Mail. I googled and found https://support.mozilla.org/en-US/questions/1346262.

I followed its suggestion of unchecking Show Only Subscribed Folders under the Advanced Tab of Server settings. They all appeared again, including the originally missing folders! However, it's now having to redownload ALL the files! I'm not sure yet what the long-term consequences are of having unchecked this option. This is a serious bug and has apparently existed for over a year.

also note that I had waited until Thunderbird had finished downloading all the existing files (the status line no longer stated that it was downloading files even when I switched to the server settings view) before concluding that the missing folders were indeed a problem and engaging in these troubleshooting efforts.

Hi, please note that 102.7.1 is outdated - you likely want to first try 102.8.0 before reporting issues.

This is a serious bug and has apparently existed for over a year.

Which //exact behavior// do you consider a bug and why?

I'm using Pop!_OS's Pop!_Shop mechanism to update applications (so they can first vet updates as working with Pop!_OS) so I can't update to 102.8.0 yet. The exact bug is some but not all folders not appearing for Linux Thunderbird, despite their appearing on OS X Thunderbird and other Mail applications. The rest is troubleshooting efforts and the resulting observations (also displaying buggy behavior). Based on observations, my hypothesis is that Linux Thunderbird, at least under some situations, is not tracking subscriptions to IMAP folders correctly. Previous postings to Thunderbird support seem to suggest this problem can occur with Windows Thunderbird as well (at least with prior versions).

As further confirmation of this hypothesis, I just used the Subscribe.. menu item (that I didn't know about before) and it showed only the deleted folder (now in the Trash folder) as being checked as subscribed. I just manually subscribed to all the folders and so far they are remaining subscribed, at least for now. I will update this report if Thunderbird loses track of the subscription information again.

Okay, I just tried deleting a folder again and again all the folders disappeared other than the deleted one, which was now in the Trash folder. I used the Subscribe.. function to confirm that all the folders had been unsubscribed. So this is now a replicable bug. I would be happy to conduct any troubleshooting tests if needed. I am also updating the name of the bug report in response to the request for more specificity to "deleting folder unsubscribes all other folders."

OS: Unspecified → Linux
Hardware: Unspecified → Desktop
Summary: folders missing → deleting folder unsubscribes all other folders

I was able to replicate this bug with Thunderbird 102.8.0, so the current version, on OS X 10.15.7. Again, using the same IMAP iCloud email account, deleting a folder resulted in all the other folders becoming unsubscribed. I performed this test twice, each time with the same result. Oddly, the consequences of unsubscribing was different. Even though Show Only Subscribed Folders under the Advanced Tab of Server settings was checked, nothing else happened. Unlike the Linux version, the folders continued to be displayed even though they were unsubscribed and the corresponding offline directories were not immediately deleted. So apparently there is a second bug which is present only in the OS X version and/or the 102.8.0 version, which negated the effects of the folder deletion bug. Also, I should add the additional information that my Linux installation of Thunderbird was via flatpak.

Error console does not show any errors during this process. The status bar seems to be alternating messages about unsubscribing and subscribing folders but is doing so quickly I can't read them. My hypothesis is that it is unsubscribing the folders for some reason and then is attempting to subscribe them but is then failing. Okay, that's it for this report, unless someone wants me to do some troubleshooting.

Does this happen with version 115?

Version 115 is significantly changed.

Flags: needinfo?(jdien07)

We do rely on your feedback to keep the bug report moving forward. This is incomplete without further feedback.

Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Flags: needinfo?(jdien07)
Resolution: --- → INCOMPLETE

While doing some testing at Bug 1975456 I saw something like what is described here. Most of the icloud folders became unsubsribed and, of course, disappeared from TB. for some unknown reason. I'll poke around some more and maybe re-open this bug.

See Also: → 1975456

I observed this problem again while installing Thunderbird 128.13.0esr on a new Linux computer (Pop!_OS 22.04).

(In reply to jdien07 from comment #11)

I observed this problem again while installing Thunderbird 128.13.0esr on a new Linux computer (Pop!_OS 22.04).

Did you see this only on icloud or maybe on other servers too? I have only seen this on icloud.
It seems like if you manually re-subscribe (right-click account, choose "Subscribe") all the missing folders, they stay OK until you do something affecting icloud folders, like delete a folder or rename a folder, then they get un-sub'd. Re-reading your comments above, this sounds similar.

Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: INCOMPLETE → ---

I've seen this with my icloud account. I've only tried a gmail account otherwise, and have not had this problem. Thanks for following up on this! :)

There is definitely something strange going on with icloud inside TB! Not sure if it's TB or icloud server causing this but I see strange strings sent to icloud by TB when TB tries to subscribe to folders (mainly after a folder is renamed, moved or deleted I think):

Example weird stuff (TB sending / IC (Icloud) responding)::

TB: 45 subscribe "Trash/TemplatesecipientåååååååSpam Statusåååååglean.validation"
IC: 45 BAD Parse Error (took 0 ms)

TB: 143 subscribe "Templatess-Italic"
IC: 143 NO [NONEXISTENT] Mailbox does not exist (took 26 ms)

I see strange LSUB response in my TB IMAP log that I record. I login to icloud using openssl and manually check lsub command.
This should show all the subscribed folders under test only, NOT every subscribed folder:

. lsub "" "test/*"
* LSUB () "/" "test/something-else"
* LSUB () "/" "Archive"
* LSUB () "/" "test/something-else/JK"
* LSUB () "/" "Templates"
* LSUB () "/" "Junk"
* LSUB () "/" "JKk"
* LSUB () "/" "Trash"
* LSUB (\Noinferiors) "/" "INBOX"
* LSUB () "/" "gds-gds&AKU-/something-else/Skr&AOQ-pppost"
* LSUB () "/" "gds-gds&AKU-"
* LSUB () "/" "test"
* LSUB () "/" "gds-gds&AKU-/something-else"
* LSUB () "/" "test/something-else/Skr&AOQ-pppost"
* LSUB () "/" "sent"
* LSUB () "/" "Drafts"
* LSUB () "/" "gds-gds&AKU-/something-else/JK"
* LSUB () "/" "Trash/gds"
* LSUB () "/" "bugzilla@mozilla"
. OK LSUB completed (took 0 ms)

This should show every subscribed folder, as it does. But this is same result as . lsub "" "test/*"

. lsub "" "*"
* LSUB () "/" "test/something-else"
* LSUB () "/" "Archive"
* LSUB () "/" "test/something-else/JK"
* LSUB () "/" "Templates"
* LSUB () "/" "Junk"
* LSUB () "/" "JKk"
* LSUB () "/" "Trash"
* LSUB (\Noinferiors) "/" "INBOX"
* LSUB () "/" "gds-gds&AKU-/something-else/Skr&AOQ-pppost"
* LSUB () "/" "gds-gds&AKU-"
* LSUB () "/" "test"
* LSUB () "/" "gds-gds&AKU-/something-else"
* LSUB () "/" "test/something-else/Skr&AOQ-pppost"
* LSUB () "/" "sent"
* LSUB () "/" "Drafts"
* LSUB () "/" "gds-gds&AKU-/something-else/JK"
* LSUB () "/" "Trash/gds"
* LSUB () "/" "bugzilla@mozilla"
. OK LSUB completed (took 0 ms)

I tested this on another imap server (my ISP's) and LSUB works correctly.
This is why TB is seeing folders unsubscribed since LSUB occurs after a folder is moved to trash and probably other times. TB relies on accurate info from LSUB and since icloud is not providing it, folders get unsubscribed.
Workaround: Just resubscribe the folders when they disappear. I don't see this as a TB issue but a huge icloud BUG !!
But I haven't found any confirmation of it yet.

Could you report this as a bug to Apple (as someone who understands this stuff)? Also, would it be possible for Thunderbird to at least provide users with a warning message to explain what is going on and what to do? It was quite alarming when I first ran into it as a newb.

Could you report this as a bug to Apple (as someone who understands this stuff)?

I've reported it here https://developer.apple.com/forums/thread/796344. I've reported stuff there before and never get any response, so not holding my breath. I also asked about it on the imap-protocol mailing list to make sure my understanding of how LSUB is supposed to work is correct.

Also, would it be possible for Thunderbird to at least provide users with a warning message to explain what is going on and what to do? It was quite alarming when I first ran into it as a newb.

Maybe, but should probably wait until there is a "won't fix" confirmation from icloud/apple or someone before changing the code to work-around this bug or pop-up an error messages or info warning in TB about this.

Summary: deleting folder unsubscribes all other folders → deleting folder unsubscribes all other folders [caused by icloud producing incorrect <tag> lsub "" "foldName/*" responses]

Here's a WIP patch that works around the icloud LSUB bug. Since icloud does work correctly with LIST command, for only icloud the patch uses LIST instead of LSUB when renaming folders.

This works but there is one (minor?) problem with using LIST instead of LSUB: If you have a hierarchy (tree) of folders to be moved, and some folder or folders inside the hierarchy are NOT subscribed (and not visible), after the move those folders will now become subscribed and, after the next folder discovery on next startup or on folder collapse/expand at root level, visible at the new location. So to hide them, they would need to be unsubscribed using TB's unsubscribe dialog.

The fix depends on icloud imap server identifying itself as "icloud mail" (case insensitive) in the imap ID response. A similar workaround for a certain version of Zimbra imap server exists in the code, but in that case it was a problem with zimbra's handling of list (subscribed) imap command.

Doing some research on the LSUB command (google search "imap" "icloud" "lsub"), I found no mention of its usage the way TB is using it when renaming folders (used for folder moves). When TB does folder discovery, it just does lsub "" "*" which icloud (and all other servers) handle correctly by listing all subscribed folders. Only when the lsub pattern lsub "" "folderName/*" is used when TB renames folders does icloud produce the wrong result: lists every subscribed folder just like lsub "" "*".

Assignee: nobody → gds
Status: REOPENED → ASSIGNED

From comment 0:

I googled and found https://support.mozilla.org/en-US/questions/1346262.

I went back and read the original comments and the above stood out. Looking at the support link, that post was about a similar problem with someone using a "Go Daddy" email account. I've never dealt directly with a GoDaddy imap server, but it appears that they provide outlook365 accounts, so they must be using an Exchange server in imap mode. All I have is a free outlook imap account that uses server outlook.office365.com. When I test moving folders in that account, LSUB works the way it should. So it appears that outlook's imap servers handle LSUB correctly and whatever caused the problem in the referenced support question was caused by something else.

Also from comment 0:

I followed its suggestion of unchecking Show Only Subscribed Folders under the Advanced Tab of Server settings. They all appeared again, including the originally missing folders! However, it's now having to redownload ALL the files! I'm not sure yet what the long-term consequences are of having unchecked this option. This is a serious bug and has apparently existed for over a year.

FYI, this would be a valid work-around to use without the comment 18 patch applied. It will probably require some one-time re-downloading and any previously un-subscribed folders will then appear, but when folders are moved or renamed, the potentially bad LSUB won't occur and trigger the observed problem with icloud imap server.

(In reply to Wayne Mery (:wsmwk) from comment #9)

We do rely on your feedback to keep the bug report moving forward. This is incomplete without further feedback.

sorry, you're asking more from me than I am capable of providing at my current level of Linux knowledge. I'm happy to provide what information I can, but after a certain point it's up to you guys to carry the ball. I'm just a Linux newb.

Gene, thanks so much for listening to users like me who don't have the technical sophistication to do things like installing nightly builds separate from our actual email clients that we install using the user-friendly Pop!_OS system and somehow not mucking up our entire email records.

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

Attachment

General

Creator:
Created:
Updated:
Size: