How to apply automatic message filters to subfolders, too?

9

5

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?

unor

Posted 2013-01-31T13:31:24.003

Reputation: 2 749

Answers

6

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

WhyWhat

Posted 2013-01-31T13:31:24.003

Reputation: 176

This doesn't seem to work anymore on version 52.9.1 (32-Bit) – toesslab – 2018-08-13T05:16:55.783

10

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"

Roman Ivanov

Posted 2013-01-31T13:31:24.003

Reputation: 221

Can confirm this works on Thunderbird 31 (Ubuntu) – paul.ago – 2014-08-26T14:03:52.693

works. +unor try to set thunderbird to automatically download messages in the folder, only when message is downloaded filters are applied. – Ohad Cohen – 2015-01-23T16:21:13.437

I tried adding this string preference, both with and without the quotes surrounding it / the value, and now I can't even manually run my rules on subfolders. Any ideas? – sab669 – 2015-08-05T20:10:48.257

Thanks for your answer. Unfortunately, this doesn't work for me. As I documented in my question, I already tried this. I tried it again now, but it still doesn't work. I added the string preference, but after restarting TB nothing changed. The filter still doesn't apply to the subfolder automatically. – unor – 2013-04-03T15:07:18.800

Oh, it worked for a mail now. Seems to work only when visiting the folder manually. I'll test some more. – unor – 2013-04-04T11:26:16.810

I don't understand why, but sometimes it takes a long time until the messages are moved. However, as soon as I visit the folder, the filter apply immediately. It's a solution, so I accept your answer. Thanks for pointing me again to this string preference :) – unor – 2013-04-08T14:14:24.460

1

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.

mgutt

Posted 2013-01-31T13:31:24.003

Reputation: 433