Filter: complex OR/AND logic in virtual Folder (Saved Search

Discussion of features in Mozilla Thunderbird
Post Reply
Posts: 353
Joined: April 8th, 2008, 4:29 am

Filter: complex OR/AND logic in virtual Folder (Saved Search

Post by Leopoldus »


I need to create some virtual folders (also known as "Saved Searches") with more complex logical syntax between several conditions. Let's say I want to get in my folder all the messages that have:
1) Age less than 3 days
2) the tag "Important"
3) the tag "Urgent"

At my first glance this need is quite simple and obvious, but I could not find any option for this. TB filter can bind all conditions either with the logic operator of the [AND] logic or with the [OR] operator, but it is not possible to combine both types of operators in the same filter.

In addition, I was looking for any work-around to solve a problem, for example, some option to run filters in a series one by one, but could not do it.

Maybe some add-ons? I checked FiltaZilla and QuickFilters, but they do not seem to offer this functionality too (or I could miss something).

User avatar
Posts: 49647
Joined: July 30th, 2003, 5:06 pm

Re: Filter: complex OR/AND logic in virtual Folder (Saved Se

Post by tanstaafl » ... hunderbird

You can work around that limitation with message filters by editing msgFilterRules.dat directly, rather than through the GUI. However, saved search uses virtualfolders.dat . It looks like you might be able to to do the same thing with that file too. You'll need to experiment.

I took a quick search using DXR in the source code but didn't spot the definitions used for searchFolderFlag. I added one saved search and noticed the file also had three saved searches for other accounts which used that flag. No idea why they existed. I didn't notice any harm after I deleted those other saved searches but perhaps its too soon to tell.
Posts: 6
Joined: January 23rd, 2016, 5:30 am

Re: Filter: complex OR/AND logic in virtual Folder (Saved Search

Post by leonard_ »

A possible help may come from addons like "Expression Search - NG" ( ... search-ng/)
However, I haven't tried it yet...Documentation speaks about the use of "regular expressions"...
Post Reply