Bug 135918 - Subject filter "contains" matches on substring instead of word
Subject filter "contains" matches on substring instead of word
Product: Fedora
Classification: Fedora
Component: evolution (Show other bugs)
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Matthew Barnes
Depends On:
  Show dependency treegraph
Reported: 2004-10-15 15:22 EDT by Edward Rousseau
Modified: 2015-04-12 19:17 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-12-31 23:50:11 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
GNOME Desktop 391472 None None None Never

  None (edit)
Description Edward Rousseau 2004-10-15 15:22:58 EDT
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

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:

Steps to Reproduce:
1. set up a subject filter with a contains line (pto)
2. send mail containing the word "laptop" in the subject.
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-23 23:47:16 EDT
This is still badly implemented in rawhide; the Filters dialog offers
     Contains, Does Not Contain, and various other options
  Regex Match
     Message Header, Message Body

Comment 3 Matthew Barnes 2006-12-31 23:50:11 EST
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.