Open Bug 1909104 Opened 2 years ago Updated 1 year ago

Make it possible to set special folder flags manually in folder properties dialog

Categories

(Thunderbird :: Folder and Message Lists, enhancement)

enhancement

Tracking

(Not tracked)

People

(Reporter: Thunderbird_Mail_DE, Assigned: gds)

References

Details

Attachments

(2 files)

It should be possible to set (change) special folder flags manually. This helps at least experienced users to adapt the folder flags to their needs ot to correct the flags, if not set properly by Thunderbird itself.

Previously, this was made possible by an add-on, but this may no longer be available in the long term. For reference, see here:
https://github.com/voccs/folderflags/

Supporting this request. Would like to know where to change the folder flags manually because the currently only known way that I could find to achieve this (via "Folderflags" add-on) will most likely not be available any longer (not maintained add-on).
I create subfolders for the "Sent" folders with year names like 2023, 2022, etc. and by setting their "Sent" flag, they are treated accordingly (i.e. a "Sent" folder icon).

I help in Thunderbird Support Forum and can confirm that for some unknown reason Thunderbird will incorrectly set flags on folders.
The most common being the Inbox gets a Drafts flag, so all incoming mail looks like a draft email when selected to read.
The only method of a fix that I'm aware of is to advise the download and use of the FolderFlags addon which adds a 'Flags' tab in the folder Properties. via which the incorrect flag can be removed.

Therefore I'm supporting this request as it is vital.

A few examples:
https://support.mozilla.org/en-US/questions/1360856
https://support.mozilla.org/en-US/questions/1370932
https://support.mozilla.org/en-US/questions/1363650

This person is using beta 101.0b2 (64-bit)
https://support.mozilla.org/en-US/questions/1377186

Version 115*
https://support.mozilla.com/en-US/questions/1442245
https://support.mozilla.com/en-US/questions/1446250

See also bug 1749538 and bug 1764095

See Also: → 1936491

(In reply to Alex Ihrig [:Thunderbird_Mail_DE] from comment #0)

It should be possible to set (change) special folder flags manually. This helps at least experienced users […]

In the unlikely case this is really necessary, experienced users may just follow these steps:

  1. Open the folder properties and copy the "Location" string.
  2. Look up the appropriate folder flag here.
  3. Open the error console and input
    MailServices.folderLookup.getFolderForURL(${location}).toggleFlag(Ci.nsMsgFolderFlags.${flag})
    replacing the ${…} values accordingly. Example:
    MailServices.folderLookup.getFolderForURL("imap://user%40example.com@imap.example.com/SomeFolder").toggleFlag(Ci.nsMsgFolderFlags.Junk)

Use at your own risk!

Look up the appropriate folder flag here.

Bad link, should be https://searchfox.org/comm-central/source/mailnews/base/public/nsMsgFolderFlags.idl.

See Also: → 1881388

Sometimes a flag needs to be removed in order to delete a folder.
Question in Support Forum was posted by a User who created subfolders in the Drafts folder, only to discover they also had a drafts flag which meant they could not be deleted.
User did not want to install addons and required an alternative manual method. Editing the 'folderCache.json' file is not a recommended method. I provided some information on how to do this - see https://support.mozilla.org/en-US/questions/1462207

Editing the 'folderCache'.json' file or trying to follow the Error Console method as mentioned in comment 3 should not be the alternative for users who cannot or do not want to use an addon for whatever reason.

Users can add custom folders to Thunderbird. This is a core feature. Therefore it must be a core feature to provide everything to be able to delete custom folders. –> add the functionality of the add-on to the core features of Thunderbird.

So the actually missing feature is rather some kind of force-delete any folder?

Attached image clear-special-flags.png —

Here's a possible way to change the "folder properties" screen to force the removal of flags that might get "stuck" on for a folder. For example, if you set another folder as Sent, Trash, Junk, Archive, Drafts or Templates, the original folder having the flag does not get the flag cleared by TB so you end up with more than one folder with the flag with no way to remove it (other than maybe deleting folderCache.json). You also see the same "special" icon on both folders now and you can't delete or rename the incorrectly flagged folder.

With this addition to the folder properties "General" dialog, you can now delete all these "special" flags for the offending folder. This allows the folder to be renamed or deleted and on restart, if folder not deleted, the icon returns to "normal" folder icon.

I'll attach my in-progress/v0 patch and have verified that it works. Currently it doesn't care which "special" flag is set and just clears them all. There is no capability to set a specific flag like the add-on has.

I think it is correct that once all the special flags on a folder are cleared, then the existing TB folder flag settings dialogs can be used to set any possible wanted flags, so there is no need for the ability to set flags in the "folder properties" dialog.

Assignee: nobody → gds
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: