Dissecting filters in msgfilterrules.dat

Discussion of general topics about Mozilla Thunderbird
Post Reply
computingatchg.me.uk
Posts: 6
Joined: October 2nd, 2013, 4:23 am
Location: London

Dissecting filters in msgfilterrules.dat

Post by computingatchg.me.uk »

I am trying to understand the parts of the above file.
"Type" is there a list of these something between 1 and 7 and maybe beyond?
"Action" reasonably straightforward.
"Action Value" here is where we need information, such as limitation to either AND/OR maybe a mix is permissible. Bracket precedence.
"Condition" what limitations and inclusions
Source documentation is very sparse on searching the web.
Any references would be appreciated
Chris

PS just do not say wrong place without explicitly stating where to post this if incorrect. you may well fell this is the wrong place but is no help if you also do not know where to post this we are not all so smart as you.
morat
Posts: 6421
Joined: February 3rd, 2009, 6:29 pm

Re: Dissecting filters in msgfilterrules.dat

Post by morat »

All possible action values aren't documented in a single file. You would have to look them up in the source.

type="1" i.e. Getting New Mail and Filter before Junk Classification (see nsMsgFilterType in nsMsgFilterCore.idl)
action="AddTag" i.e. Tag Message
actionValue="$label1" i.e. Important

Code: Select all

Components.interfaces.nsMsgFilterType.InboxRule; // 1

Code: Select all

MailServices.tags.getAllTags()[0].key; // $label1
MailServices.tags.getAllTags()[0].tag; // Important

MailServices.tags.getAllTags()[1].key; // $label2
MailServices.tags.getAllTags()[1].tag; // Work

MailServices.tags.getAllTags()[2].key; // $label3
MailServices.tags.getAllTags()[2].tag; // Personal
Reference
http://searchfox.org/comm-esr91/source/ ... erCore.idl
http://searchfox.org/comm-esr91/search? ... properties

Message Filters
http://kb.mozillazine.org/Message_Filters
computingatchg.me.uk
Posts: 6
Joined: October 2nd, 2013, 4:23 am
Location: London

Re: Dissecting filters in msgfilterrules.dat

Post by computingatchg.me.uk »

Thank you for your information I will go away and digest
morat
Posts: 6421
Joined: February 3rd, 2009, 6:29 pm

Re: Dissecting filters in msgfilterrules.dat

Post by morat »

I read that you shouldn't create a condition rule mixed with "AND" and "OR".
aceman wrote:The proper format of a filter must always have either all operators being AND or all of them being OR.
Bug 1312172 Comment 10
http://bugzilla.mozilla.org/show_bug.cgi?id=1312172#c10

Also, I read that the filter engine is capable of processing arbitrarily complex boolean expressions.

Bug 297852
http://bugzilla.mozilla.org/show_bug.cgi?id=297852

More info: http://forums.mozillazine.org/viewtopic ... &t=3046341
Post Reply