Closed Bug 1717237 Opened 3 years ago Closed 3 years ago

Custom filter fields are made lower-case while filtering is case-sensitive. This breaks custom filters.

Categories

(Thunderbird :: Filters, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: emmett, Unassigned)

Details

+++ This bug was initially created as a clone of Bug #928372 +++

Thunderbird version 78.10.1 (64-bit)

Steps to reproduce:

Create new custom filter.
Add custom field "Reply-To" or "DMARC-Filter" (tried both)
Use with contains and expected content.

Applied filter -> Nothing happened.

Checked: msgFilterRules.dat -> Found error there!

Actual content: condition="AND ("dmarc-filter",contains,OpenDMARC Filter")
Should be: condition="AND ("DMARC-Filter",contains,OpenDMARC Filter")

Unlike the cloned bug report, manually changing msgFilterRules.dat seems to stick on Thunderbird restart. But It does not stick if you update the filter again.

Error Description

Custom filter fields are transformed to lower case while the actual string matching the header name seems to be case sensitive. I don't believe it should be a case sensitive search.

"Contains" strings are not coerced to lower case and remain as entered in the filter editor dialog.

Actual results:

Nothing, until I manually edit filter msgFilterRules.dat.

Manual fixes of msgFilterRules.dat are reverted to lower case on edit filter update.

Expected results:

Emails that match should have been moved to other folder after creation or update of custom filter.

Either the search for header name be case insensitive, or the edit filter dialog saves the header name as entered by user

Turns out that the filters do get reset to lower case when restarting Thunderbird.

Also, how doe the filter edit dialog remember the string's case as saved, while the dat file only see it a lower case? I mean, why does the custom filter field read "DMARC-Filter" in the entry field, as entered when last saved, but the data file has "dmarc-filter"?

Yes, you are right. The header name is stored in the msgFilterRules.dat file in lower case.

But that doesn't cause any problems here (TB78.12). I created some test mails with a header in different upper and lower case and all spellings are found successfully. Doesn't that work for you?

It turns out that the filters does work, but not immediatly. I assume thunderbird has to be restarted. I did just verify that the filters in teh .day file are all lower case, and the filter has been working for some time.

Still, How does the UI know the original case of the filter when you edit a filter?

I suppose this bug should be closed as my original concern seems to ahve been addresses. In that custom filters do work, eventually.

(In reply to Emmett Culley from comment #3)

Still, How does the UI know the original case of the filter when you edit a filter?

The spelling is taken from the pref mailnews.customHeaders where TB remembers those headers.

I suppose this bug should be closed as my original concern seems to ahve been addresses. In that custom filters do work, eventually.

OK

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.