Bug 135918 - Subject filter "contains" matches on substring instead of word
Summary: Subject filter "contains" matches on substring instead of word
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: evolution
Version: rawhide
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Matthew Barnes
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-10-15 19:22 UTC by Edward Rousseau
Modified: 2015-04-12 23:17 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2007-01-01 04:50:11 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
GNOME Bugzilla 391472 0 None None None Never

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


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