Red Hat Bugzilla – Bug 135918
Subject filter "contains" matches on substring instead of word
Last modified: 2015-04-12 19:17:18 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):
Steps to Reproduce:
1. set up a subject filter with a contains line (pto)
2. send mail containing the word "laptop" in the subject.
laptop is filtered.
laptop not be filtered.
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
Anyhow filter rules in general should be better documented.
This is still badly implemented in rawhide; the Filters dialog offers
Contains, Does Not Contain, and various other options
Message Header, Message Body
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 
for further updates.