user3001
user3001

Reputation: 3497

Advanced message filter rules in Mozilla Thunderbird

The filter mechanism of Thunderbird is nice for simple things. But I want to do something like

(If message contains xy or sender is yz) and status is read, move to trash

The problem is, one filter rule can only match any (= OR) or all (=AND) filterconditions. I tried working around with that by first marking all the messages with an unprobable combination of tags in a first filter and then use a second filter to move all the marked+tagged messages to trash if they are read, but this works very poorly, as sometimes messages aren't being marked, sometimes marked messages are not deleted.

The purpose of all this is to delete unimportant or notification emails as soon as I read them. Of course I could do a seperate filter for each of them, but if I wanted to change something, it gets tedious for all >20-30 filter rules.

Is it somehow possible to hack into the filter configuration or is there some other way of complex filtering using only ONE filter?

Btw. I'm using Gmail+IMAP if that could be important.

Upvotes: 24

Views: 21401

Answers (4)

Pierre
Pierre

Reputation: 4414

You can also manually edit the msgFilterRules.dat file in the \Users... folder.

(A || B) && C becomes:

condition="AND (OR (body,contains,A) OR (body,contains,B) AND (to,contains,C)"

Note first parenthesis is mismatched.

Change the condition depending on your requirements. Look at other filters, or create test filters to learn the syntax empirically. Note there are several msgFilterRules.dat for different Email addresses and folders.

Upvotes: 6

Nabil Kadimi
Nabil Kadimi

Reputation: 10414

I strongly suggest using FiltaQuilla as suggested in MozillaZine.

Example

Hers is my filter for:

  • From contains @yahoo.es
  • Subject is photo, selfie or image, plus plurals, case insensitive

ThunderBird filter with regular expression

Upvotes: 7

Martin Pecka
Martin Pecka

Reputation: 3083

A much less nice, but working solution, could be to convert your requirements to disjunctive normal form. That means creating several filters, each of them having "AND" parts. As multiple filters are independent, running them one after another simulates the "OR" part.

In your particular case, (message contains xy OR sender is yz) AND status is read = (message contains xy AND status is read) OR (sender is yz AND status is read).

That means you should create two filters, one for message contains xy AND status is read and the other for sender is yz AND status is read

Upvotes: 6

Aurelien
Aurelien

Reputation: 163

I don't think there is a way to do exactly what you want. But I can suggest this workaround:

  1. Create a first filter to store the messages in a specific folder (folder1), based only on the sender
  2. Create a search folder (folder2), to select only the read messages from folder1
  3. Periodically (manually) delete the messages from folder2. Unfortunately, I didn't find a way to do this automatically

I use this system to delete some daily notifications, which become useless after a few days.

Upvotes: 1

Related Questions