Filtering emails based on Sender, Subject and Body

0

I am using Thunderbird 9.

My input is a series of emails I receive regularly that I want to filter at two levels.

First, if the email is from a specific sender and contains one of a set of strings, I want it to be moved to a folder. I cannot create a filter with clauses like X AND (Y OR W OR Z) which is what I need. How can I do this?

Second, once this filtering is done, I would like to flag as Important (and maybe do something else) any message in the filtered set that contains a specific string in the body. To do this I read about FiltaQuilla and its Javascript integration, but I wasn't sure how to use it for "filtering" instead of "filter action".

I know the filtering I am performing would be better done at mail-server level, but I don't have that option. Is what I am trying to do possible?

mdm

Posted 2012-01-13T12:37:06.527

Reputation: 103

Answers

1

Thunderbird filters are processed in sequence unless you explicitly put in a condition that stops flow. So with these two things, you can usually achieve AND and OR operations.

If email is from X and contains Y move to folder
If email is from X and contains W move to folder
If email is from X and contains Z move to folder

So this sequence effectively comes out as "If email contains (Y or W or Z) and is from X then move to folder.

If you want to flag as important, you effectively have to do the test again (using match all):

If email is from X and contains Y and contains T flag important and potentially do something else
If email is from X and contains W and contains T flag important and potentially do something else
If email is from X and contains Z and contains T flag important and potentially do something else

So all of the filters will run, and it is about ordering them right to achieve what you want. It isn't as elegant as a proper boolean parentheses logic, but mostly you can get there, just with many more filters. And you can use the "Stop Processing Filters" action if something later on will match where you don't want it to.

Paul

Posted 2012-01-13T12:37:06.527

Reputation: 52 173

Thanks! But, what if I needed, for the second set of filters, a more powerful tool than a simple "Body contains"? What if I have to match regexes on lines granulatiry? Is FiltaQuilla what I need then or not? – mdm – 2012-01-13T14:20:45.127

1FiltaQuilla just has additional actions rather than additional conditions. How about adding the other requirements to the question, and we can enhance the answers to match? – Paul – 2012-01-13T22:33:37.683