Closed Bug 1558781 Opened 6 years ago Closed 3 years ago

Empty filter works

Categories

(Thunderbird :: Filters, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1569831

People

(Reporter: for_garbage, Unassigned)

References

Details

(Whiteboard: [dupme])

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0

Steps to reproduce:

Run an old "empty" filter.

Actual results:

Filter works: some messages are moved to other folder

Expected results:

Nothing

I have noticed that as result of applying one filter some messages are moved to the target folder unexpectedly. After removing all entries from that filter it still works (i.e. messages are moved)

Please be more precise. What do you mean by "removing all entries from filter"?

Flags: needinfo?(for_garbage)

All condition entries had been removed.

Flags: needinfo?(for_garbage)

I have created a new filter with the set of conditions but it also is working incorrectly: messages that definitely do not meet the conditions are moved to the target folder.

Hard to say what's going on. We'd need your precise filter definition and test data, like the messages that should not get moved. Any add-ons interfere here?

Benjamin, you could work with this user to reproduce the issue.

Flags: needinfo?(benjamin)

Only Lightning and Shockwave Flash are installed.

Hey for_garbage,

This is what I've tried based on what I could gather from the above. I wasn't able to trigger the bug on my end, so here are the steps I took.

First Attempt:

1.Created a filter with no "filter" as in I left the conditional statements empty
2. Ran the filter, no anomalous activity

Second Attempt:

  1. Created a filter with a "From" conditional statement and ran the filter to verify it works.
  2. Moved the messages the filter caught back into the inbox
  3. Removed conditional statement from the filter
  4. Ran the filter, no anomalous activity.

Maybe there is a time or version component to the bug so how old is this old filter? Did you create it in an earlier version of TB? Do you remember what version?

Flags: needinfo?(benjamin)

About 4-5 years. No chance to remind that version. Where the filter's data are stored? Let's start from checking this.
BTW, how much time does it take to setup the environment to debug it in place (approximately)?

More filter trouble here, Aceman.

Flags: needinfo?(acelists)

Any updates?

Sorry for the delay for_garbage,

The team is working on finalizing the next version of TB so turn around can be a little slow.

You can check to see if there is anything weird going on if you open up the developer console and then run the filters manually.

You can find the console by going to Tools-->Developer Tools-->Error Console or Ctrl+Shift+J.

Thunderbird stores its hidden files in the %appdata% folder on windows. Be careful messing around with the files though as you could really make a mess of your install.

Flags: needinfo?(for_garbage)

I would say there is nothing specific in that console (except the strange UI of console itself).

Flags: needinfo?(for_garbage)

Yeah, sometimes the console doesn't give much. However, I'm at a loss. I haven't been able to duplicate it on my end. Hopefully Aceman can shed some light on it.

The filter definition is stored in the msgFilterRules.dat file in your profile and subdirectory representing that particular mail account.
You could look into that file whether the filter is really defined as empty (no rules). You can find the filter by its name in the file.

It is a question whether an empty filter should match any message. Does any message match a filter where all 0 rules are fulfilled? Yes, it does, purely logically. But it may be unpractical and then we could prevent creating such filters in the UI.
We have a similar logical problem in another bug, whether an empty sender address (in the message) is in a particular addressbook or isn't. Or something like that.

Flags: needinfo?(acelists)

(In reply to :aceman from comment #14)

The filter definition is stored in the msgFilterRules.dat file in your profile and subdirectory representing that particular mail account.
You could look into that file whether the filter is really defined as empty (no rules). You can find the filter by its name in the file.

It is a question whether an empty filter should match any message. Does any message match a filter where all 0 rules are fulfilled? Yes, it does, purely logically. But it may be unpractical and then we could prevent creating such filters in the UI.

I was trying to find a matching bug report and have found none https://mzl.la/30iCByN ... except (not a match) ...

We have a similar logical problem in another bug, whether an empty sender address (in the message) is in a particular addressbook or isn't. Or something like that.

Indeed Bug 391717 - filter with From:/To: criteria doesn't work if message's address is null or missing (neither IsInAB nor IsntInAB filter operator matches the address)

reporter, can you still reproduce?
And what are the contents of bug msgFilterRules.dat for this filter?

Flags: needinfo?(for_garbage)

It is still reproduced. It is actually empty, the condition line is : condition="OR (from,is,)".

Flags: needinfo?(for_garbage)
Whiteboard: [dupme]
See Also: → 1569831

Another case of "Bug not actionable because there are no proper STR".

I'm not sure how we could even try to triage this because there are so many unknowns and assumptions. Here are some:
(Please use bmo comment reply button and inline replies)

  • Reporter, we need a numbered series of steps exactly how to create your "empty" filter and how to apply it. Every single detail, no matter how boring or irrelevant it may seem. We don't have mind-reading modules. In comment 17, suddenly it becomes an OR search, and using IS instead of "contains" which is default - I doubt anyone testing this was aware of that.
  • pls provide your TB version where you last tested this (help > about thunderbird)
  • removing all conditional statements is NOT possible for me in TB 78 (and certainly the same before): The first condition has the [-] button disabled, so you can't remove it. You can only leave the filter criterion empty, and 'From is empty' looks like a valid condition (not sure if we parse it that way, that needs another check).
  • did you select the filter in the filter list and click "Run now"?
  • what is the reason to run or keep enabled a filter which does nothing for you, instead of disabling, not running, or deleting it?
  • the messages which you claim were moved by this filter, what do they have if you inspect From header in message source?
  • does this "bug" occur for you with help > restart with addons disabled?

I tested OR(from,is,) run manually on 84.0a1 (2020-10-20) and 78.4.0 (64-bit) and it's not moving any messages, but then, I don't have messages with empty from.

Flags: needinfo?(for_garbage)

One notable thing is that we don't update filter.dat with changed conditions unless you close the main (first) filters dialog. That looks wrong and a recipe for confusion, because the runtime filter state differs from the saved filter state, and if you switch off your computer or it crashes, filter changes will be lost.

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

  • Reporter, we need a numbered series of steps exactly how to create your "empty" filter and how to apply it. Every single detail, no matter how boring or irrelevant it may seem. We don't have mind-reading modules. In comment 17, suddenly it becomes an OR search, and using IS instead of "contains" which is default - I doubt anyone testing this was aware of that.

It is impossible to remember this exactly. As I told previously there was a plain filter contained a set (~60 entries) of simple equal conditions ("from" == "addr") with one simple action (moving messages to different local folder). Once I realized that some messages are moved to the target folder unexpectedly (i.e. "from" field of that messages was definitely not equal to one of filter's condition entries). Just to do a simple test I removed all condition entries and realized that "empty" filter still worked (i.e. some message was moved to the specified folder after running the filter for incoming folder manually)

  • pls provide your TB version where you last tested this (help > about thunderbird)

My current version is 68 and I still observe the specified unexpected behavior (Why 68? It should be updated automatically, the corresponding option is set. I will update results for the latest version later).

  • removing all conditional statements is NOT possible for me in TB 78 (and certainly the same before): The first condition has the [-] button disabled, so you can't remove it. You can only leave the filter criterion empty, and 'From is empty' looks like a valid condition (not sure if we parse it that way, that needs another check).

Yes, at least for V.68 I observe the same behavior. The last entry of discussed filter contains empty argument field ("from" == <empty>). Probably the initial non-empty problematic filter also contained the empty condition.

  • did you select the filter in the filter list and click "Run now"?

Exactly.

  • what is the reason to run or keep enabled a filter which does nothing for you, instead of disabling, not running, or deleting it?

See first comment in this thread. The initial problem is not the empty filter but incorrect working of non-empty one.

  • the messages which you claim were moved by this filter, what do they have if you inspect From header in message source?

There are no surprises. Some simple valid non-empty e-mail address, that is not listed in filter conditions. I do not see any logic except that all messages with the same "from" field are incorrectly matched and moved (i.e. it is not just random matching)

  • does this "bug" occur for you with help > restart with addons disabled?

No addons are installed. I will check that "safe mode" and inform about results.

I tested OR(from,is,) run manually on 84.0a1 (2020-10-20) and 78.4.0 (64-bit) and it's not moving any messages, but then, I don't have messages with empty from.

I don't have it also.

P. S. I suppose it would be better to debug it in place. Is there any help page to quickly setup the debug environment?

Flags: needinfo?(for_garbage)

You're not able to create a new, empty filter using version 78, correct?

If no and if the filter really is empty, then I don't think this is worth spending time on - the probability of finding the cause is extremely low, especially given how long ago it occurred. The only thing worth pursuing IMO is to prevent an empty filter from taking any action.

What do you think Thomas?

Flags: needinfo?(bugzilla2007)
Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Flags: needinfo?(bugzilla2007)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.