Open Bug 1465076 Opened 7 years ago Updated 2 years ago

Implement filter operators "contains any of" and "contains all of" to support multiple search terms in a single rule (in addition to "contains string")

Categories

(Thunderbird :: Filters, enhancement)

enhancement

Tracking

(Not tracked)

People

(Reporter: thomas8, Unassigned)

References

Details

(Keywords: papercut)

+++ This bug was initially created as a clone of Bug #1438379 +++ Advanced Search / Message Filters. Defining filters with multiple search terms for the same criterion is way to complicated. If you want to filter for multiple email addresses, you need to create a new condition for every single email address: > To contains foo@bar.com > To contains bar@asdf.com > etc. etc. Same for other obvious fields like subject. If you want to find messages with subject which has all of more than one search word: > Subject contains foo > Subject contains bar > etc. etc. We need to implement new operators that allow convenient quick filter / google style search terms also in Advanced Search and Message Filters. "contains any of" -> contains any of the search words "contains all of" -> contains all of the search words "contains string" (that's the current operator) I don't think it can be very difficult to translate those new operators internally into the correct syntax, e.g.: Subject "contains all of" "foo bar" -> internally translated as: Subject "contains string" "foo" AND Subject "contains string" "bar" I guess we could make it so that double quotes will keep terms together, which would then also require an escape character to search for actual quotes. grrrr. Why things have to complex... But still, isn't this doable?
Summary: Implement filter operators "contains any of", "contains all of", and "contains string" to support multiple search terms in a single rule → Implement filter operators "contains any of", "contains all of", in addition to "contains string" to support multiple search terms in a single rule
Summary: Implement filter operators "contains any of", "contains all of", in addition to "contains string" to support multiple search terms in a single rule → Implement filter operators "contains any of" and "contains all of" in addition to "contains string" to support multiple search terms in a single rule
Summary: Implement filter operators "contains any of" and "contains all of" in addition to "contains string" to support multiple search terms in a single rule → Implement filter operators "contains any of" and "contains all of" to support multiple search terms in a single rule (in addition to "contains string")
Or maybe "any of", "all of", and "string" should be in a separate dropdown field after the operator, to apply for any operator even "is" "isn't", "begins with", "ends with". Our choices for not operator are also pretty random, what if I need "does NOT begin with"? Yeah, so the whole design isn't good, but maybe this would be an easy temporary gain until such time that we fully fix this.

Just spent some time trying to guess a proper separator for such a filter.
Want to filter a lot of emails at once, with single rule like "from" -> "contains any of" -> "example1@example.com, example2@example.com, example3@example.com"
Still hope I'm just missing something.

OK, bug 297852 told it is not possible for now. Asked in comment 54.
So, addons like Filtaquilla seem to be the only way to avoid generating similar filters.

See Also: → 297852

(In reply to travneff from comment #3)

Just spent some time trying to guess a proper separator for such a filter.
Want to filter a lot of emails at once, with single rule like "from" -> "contains any of" -> "example1@example.com, example2@example.com, example3@example.com"
Still hope I'm just missing something.

Create an address book with example1, example2, ..... then set the filter From + is in my address book + <choose an address book>.

(In reply to sfhowes from comment #6)

Thanks a lot, it works!
However I'll still wait for the subject feature -- to block entire domains.
Like "all emails from @baddomain1.com AND @baddomain2.com"
Address book seems to match exact address only.

Set 'Match any of the following', add From + ends with + baddomain1.com, click the button with + and add the same rule with baddomain2.com.

(In reply to sfhowes from comment #8)

Set 'Match any of the following', add From + ends with + baddomain1.com, click the button with + and add the same rule with baddomain2.com.

Assuming I got you right: I have tens of domains to match. That's why I don't want tens of filtering rules. One rule with OR would be enough -- but it is not possible (?) for now.

See Also: → 1683162
See Also: → 1588155

(In reply to Axel Grude from comment #10)

This is a duplicate of https://bugzilla.mozilla.org/show_bug.cgi?id=297852

Certainly related - but so far I'm seeing this bug 1465076 as a subset trying to go for quick gains. I might be wrong.

Keywords: papercut

(In reply to Thomas D. (:thomas8) from comment #11)

(In reply to Axel Grude from comment #10)

This is a duplicate of https://bugzilla.mozilla.org/show_bug.cgi?id=297852

Certainly related - but so far I'm seeing this bug 1465076 as a subset trying to go for quick gains. I might be wrong.

I think you may be right - having an operator "is contained in list" with a JSON array or something similarly structured (array) would be the quickest way to resolve this. It could be simply a string of the format:

["text1"]
["text1","text2"]
["text1","text2","text3"]
etc.
double quotes within the strings could be escaped with " or in a similar way...

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.