Bug 135918

Summary: Subject filter "contains" matches on substring instead of word
Product: [Fedora] Fedora Reporter: Edward Rousseau <rousseau>
Component: evolutionAssignee: Matthew Barnes <mbarnes>
Status: CLOSED UPSTREAM QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: ineilsen, rousseau
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-01-01 04:50:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Edward Rousseau 2004-10-15 19:22:58 UTC
Description of problem: I have a filter that checks if the subject
contains pto and then moves the message to a folder. I would expect
the filter to look for the word "pto". The filter though matches on
the substring "pto" so while subject lines such as "PTO today",
"Taking pto" and "PTO" trigger the filter so does any email with the
phrase "laptop" which is not what I intended. The other option would
be to use a subject is filter which would catch "pto", but not "pto
today".  

The help documentaition does not make clear what "contains" actually
means for the rule.

Version-Release number of selected component (if applicable):
evolution 2.0.2

How reproducible:
Always

Steps to Reproduce:
1. set up a subject filter with a contains line (pto)
2. send mail containing the word "laptop" in the subject.
3.
  
Actual results:
laptop is filtered.

Expected results:
laptop not be filtered.

Additional info:

There are a number of ways to approach this. One possible way would be
to split contains into 2 selections: contains word, and contains
substring. Or you could make contains search on word and add a
substring selection for filter. It seems as if the code is making any
substring match trigger the filter. It should probably parse the field
 with a space token and then try to exact match the filter text to the
subject line pieces and not match on substring.

Workaround is to add a leading and trailing whitespace around " pto "
in the filter text. (which one could argue is not all that good of
behavior either).

Anyhow filter rules in general should be better documented.

Comment 1 Dave Malcolm 2005-08-24 03:47:16 UTC
This is still badly implemented in rawhide; the Filters dialog offers
  Subject
     Contains, Does Not Contain, and various other options
  Regex Match
     Message Header, Message Body



Comment 3 Matthew Barnes 2007-01-01 04:50:11 UTC
Reproduced the problem in the latest Rawhide release (2.9.4).  I'm forwarding
this upstream and will continue tracking the problem there.  Please refer to [1]
for further updates.

[1] http://bugzilla.gnome.org/show_bug.cgi?id=391472