Advanced message filter rules in Mozilla Thunderbird
Asked Answered
B

4

23

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.

Bashuk answered 13/1, 2012 at 11:30 Comment(0)
N
6

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

Newsprint answered 2/4, 2016 at 1:40 Comment(1)
This only shows ANDs of conditions, not also ORs.Milissamilissent
A
5

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

Antevert answered 16/10, 2013 at 13:3 Comment(1)
Of course, you can only use this method if your condition doesn't contain much atoms, because otherwise it could 'explode' to an overwhelming number of filters, which you (IMHO) don't want.Antevert
C
5

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.

Critta answered 20/10, 2019 at 15:49 Comment(1)
Seems they decided that was a parsing bug and fixed the "feature". If it worked Oct 2019, it definitely does not work Feb 2021Isabel
P
1

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.

Portuna answered 3/3, 2012 at 20:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.