How to apply automatic message filters to subfolders, too?

Thunderbird's message filters (ToolsMessage Filters…) seem to only fire on Inbox automatically. If you want to filter on subfolders, you'd have to start this filter manually (ToolsRun Filters on Folder).

How can I filter mails in subfolders automatically, too?

I found the (now EOL'ed) extension Filter Sub Folders. There it says:

It turns out that there's already functionality to do filtering on sub folders in Thunderbird, it's just not well documented (indeed, it's barely documented at all). It can be enabled by setting the preference "mail.server.default.applyIncomingFilters" to true, or can be applied per folder by setting the "applyIncomingFilters" property to a folder.

I searched for the property mail.server.default.applyIncomingFilters, but didn't find it. So I added it (as string, according to this issue) and set its value to true. But this didn't work. After restarting TB the mails in subfolders didn't get filtered.

FilterQuilla (https://addons.mozilla.org/en-us/thunderbird/addon/filtaquilla/) is reported to be able to set that property, although I haven't tested it.

It doesn't say anything about that in the description.


Similar (but not same) question: How can I get Thunderbird to automatically move messages?

See also (useful to have it combination): How can I get Thunderbird to check subfolders on IMAP?


Solution 1:

According to [1], set up Thunderbird to run filters on subfolders:

  1. Click the "Tools" menu
  2. Click the "Options" sub-menu
  3. Select the "Advanced" and "General" tab
  4. Click the "Config Editor..." button
  5. [Optional] Click the "I'll be careful (...)" button
  6. Right click on top of any of the preferences shown and click "New >"
  7. Select "String"
  8. Preference name: mail.server.default.applyIncomingFilters
  9. Preference value: true

Now the second problem is that the filters only work when you click the sub-folder. This seems to be because filters are only executed when new messages are downloaded and that only happens when you click the sub-folder.

According to [2], set up Thunderbird to download messages whenever new mail is detected:

  1. Go to the Config Editor (if needed, see above how to get to the "Config Editor..." button)
  2. Set mail.imap.use_status_for_biff to false
  3. Set mail.server.default.autosync_offline_stores to true

As pointed out in [2], please see the following observations

The advantage of the AutoSync settings is that (...) any downloading is not delayed until you go offline.

(...)

If you use it, be careful about how you configure Thunderbird to check for new mail, to avoid it downloading folders that you didn't expect.


[1] http://forums.mozillazine.org/viewtopic.php?f=39&t=1444045&p=12768821#p12768821

[2] http://kb.mozillazine.org/Offline_folders#AutoSync

Solution 2:

To make filtering works for subfolders: create a new string preference "mail.server.default.applyIncomingFilters" to "true". Even if it seems odd, do NOT create a boolean setting, it has to be a STRING setting with the value "true".

Source: http://forums.mozillazine.org/viewtopic.php?f=39&t=1444045&p=12768821#p12768821 see reply of "geoyo1"

Solution 3:

You can solve your problem by using the Shedule-Filters Add-On. It still works with TB 52, but you need to install it manually.

After the installation you need to display the usual menu bar:

enter image description here

and then you find it under "Tools". Now you only need to mark the specific subfolder and select Tools -> Add message filters in folder schedule and define an interval. After that all your filters will run on this subfolder every X minutes:

enter image description here

In combination with FiltaQuilla's search term "Folder Name" this is really powerful because you can create general rules that only apply to certain folders and they run automatically!

In my opinion this should be a TB built-in feature.