Last Comment Bug 618624 - in message filter "content-type" for News account, I am missing "doesn't contain" choice (News only problem)
: in message filter "content-type" for News account, I am missing "doesn't cont...
Status: VERIFIED FIXED
:
Product: MailNews Core
Classification: Components
Component: Filters (show other bugs)
: 7
: All All
: -- normal (vote)
: Thunderbird 10.0
Assigned To: :aceman
:
Mentors:
: 598181 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-12-11 16:01 PST by horst
Modified: 2012-01-11 23:58 PST (History)
6 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
1st attempt at a fix (3.97 KB, patch)
2011-10-20 14:31 PDT, :aceman
rkent: review-
Details | Diff | Splinter Review
2nd try (4.02 KB, patch)
2011-10-21 10:58 PDT, :aceman
Pidgeot18: review-
Details | Diff | Splinter Review
next try, only touching InitNewsFilterTable [Checkin: comment 14] (2.49 KB, patch)
2011-10-26 12:26 PDT, :aceman
Pidgeot18: review+
Details | Diff | Splinter Review

Description horst 2010-12-11 16:01:09 PST
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7

in message filter "content-type" I am missing "doesn't contain" choice

Reproducible: Always

Steps to Reproduce:
1.creating a filter rule 
2.under "customize" add "Content-type"
3.under possibe operators I miss "doesn't contain"
Comment 1 Jo Hermans 2010-12-11 17:37:00 PST
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7

works for me
Comment 2 rsx11m 2010-12-11 18:33:10 PST
Here too, same build and platform but without Lightning installed. Do you have any extensions that may interfere? Check Tools > Add-ons > Extensions.
Comment 3 horst 2010-12-12 13:31:51 PST
noticed now that the problem appears only in newsgroups
Comment 4 Ludovic Hirlimann [:Usul] 2010-12-14 08:54:01 PST
Anything (errors in particular) in Tools -> Error console when you create the filter ?
Comment 5 horst 2010-12-14 09:51:31 PST
Played a bit with the filter, run it but didn't get any error in the console.
Comment 6 :aceman 2011-10-18 12:12:22 PDT
I can confirm this on Thunderbird 7, linux, on newsgroup account.
Any custom header only gives these options: contains, is, begins with, ends with. The builtin headers all have their own options (operators), depending on their value type (like date, numeric). Textual headers like Subject also additionally allow 'doesn't contain', 'isn't'.
It happens also in safe mode. My suggestion is to allow every possible operator on a custom header (even the numeric ones, like 'greater', 'is before'). It is up to the user to know what values the header may have.
Comment 7 :aceman 2011-10-19 11:13:33 PDT
Confirming it is on news account only. And the test was on TB8beta, not 7.
Comment 8 :aceman 2011-10-20 14:31:14 PDT
Created attachment 568520 [details] [diff] [review]
1st attempt at a fix

I think negations of existing string operations should be safe.
Comment 9 Kent James (:rkent) 2011-10-21 10:14:52 PDT
Comment on attachment 568520 [details] [diff] [review]
1st attempt at a fix

This patch is somehow not created correctly, so will not apply. The code itself looks OK but I would still like to compile and run it.

The preamble is:

--- nsMsgSearchNews.cpp	2011-10-19 12:38:21.000000000 +0200
+++ nsMsgSearchNews.cpp.new	2011-10-20 23:24:42.000000000 +0200
@@ -474,18 +474,22 @@ nsresult nsMsgSearchValidityManager::Ini


A typical patch of mine, using hg with mq to generate, would look like:

# HG changeset patch
# Parent ef977dca2337aebabfd77af8d02a9d8a394d849b
bug 668952 - Inbox corruption/error message  occurs with "move to folder" filters

diff --git a/mailnews/local/src/nsPop3Sink.cpp b/mailnews/local/src/nsPop3Sink.cpp
--- a/mailnews/local/src/nsPop3Sink.cpp
+++ b/mailnews/local/src/nsPop3Sink.cpp
Comment 10 :aceman 2011-10-21 10:58:21 PDT
Created attachment 568711 [details] [diff] [review]
2nd try
Comment 11 Kent James (:rkent) 2011-10-24 14:17:41 PDT
Comment on attachment 568711 [details] [diff] [review]
2nd try

Looking at this again, I don't think this will work - but this is Joshua's code so he should comment. This code is not the base search code, but the online server code, so the online search calls need to support this.
Comment 12 Joshua Cranmer [:jcranmer] 2011-10-26 11:42:35 PDT
Comment on attachment 568711 [details] [diff] [review]
2nd try

As rkent fears, this doesn't work with online XPAT searches, but it does work for filters. Rip out the features for search and only keep the one for filters--I'm not going to try to ask you to get online search working because some brief tests indicate that it involves a lot more hackery to go in.
Comment 13 :aceman 2011-10-26 12:26:06 PDT
Created attachment 569755 [details] [diff] [review]
next try, only touching InitNewsFilterTable [Checkin: comment 14]

I do not know what are XPAT searches.

But I'd like to understand why there are different capabilities in the various Init<protocol>[Filter]Table functions...
Comment 14 Jens Hatlak (:InvisibleSmiley) 2011-11-05 11:19:14 PDT
Comment on attachment 569755 [details] [diff] [review]
next try, only touching InitNewsFilterTable [Checkin: comment 14]

http://hg.mozilla.org/comm-central/rev/1662ababd5c0
Comment 15 :aceman 2012-01-11 23:58:04 PST
*** Bug 598181 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.