Bug 1450560 - Mis-filters emails with Mailing List rule in certain situations
Summary: Mis-filters emails with Mailing List rule in certain situations
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: evolution-data-server
Version: 25
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Milan Crha
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-13 06:01 UTC by Kevin L. Mitchell
Modified: 2017-05-19 07:46 UTC (History)
4 users (show)

Fixed In Version: evolution-data-server-3.24.3
Clone Of:
Environment:
Last Closed: 2017-05-19 07:45:53 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Misfiled spam (29.91 KB, text/plain)
2017-05-18 13:25 UTC, Kevin L. Mitchell
no flags Details

Description Kevin L. Mitchell 2017-05-13 06:01:26 UTC
Description of problem:

I am subscribed to several email lists; to make the most sense of them, I have several filters set up to move incoming messages from certain lists to folders specifically for those lists.  In one case, I have a filter to move all email from lists at a given domain into a single folder, using "Mailing list contains @example.com".  Recently, I've had a lot of spam that, while absolutely not matching that domain, gets picked up and acted on by that filter.  The string "@example.com" does not appear anywhere in the spam messages, and in fact the spams don't even appear to contain a "mailing-list" header, at least in the cases I've seen.  I've taken to creating "rules from mailing list" to stop processing before the messages get to the mailing list filters, and invariably I've found that the mailing list that evolution seems to think the spams went to does not contain any '@' in it whatsoever.  Other things I've definitely discovered: it does not matter what comes after the '@' in my rules, the spams are sent to the first folder for which the rule is "mailing list contains @…"; and none of the "mailing list is …" rules get any of the spams (unless they actually did go to those mailing lists).

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

evolution-3.22.6-2.fc25.x86_64

How reproducible:

I haven't figured out how evolution decides what the mailing list of the problematic spams is, as there does not seem to be any obvious mailing list header or other variant; but when one of these spams comes in, evolution 100% filters the spam to the wrong folder.

Steps to Reproduce:
1. Have a message filter for "Mailing list contains @example.com"
2. Receive a spam that evolution decides went to a mailing list without '@' in the name

Actual results:

Evolution filters the message using a rule that cannot conceivably match the message.

Expected results:

Since none of my rules actually match the messages, evolution should not apply any rules at all to the messages.

Additional info:

I originally saw this behavior in the Fedora 21 version of evolution: I started to see spam messages that triggered the bug after FC21's EOL.  Indeed, I was hoping that finally updating to FC25 would fix the bug.

Incidentally, the messages that are triggering this behavior are being sent to domains that have absolutely no connection whatsoever to the domain of the mailing list.  Further, I've reduced the number of rules of this pattern ("Mailing list contains @example.com") I have, and confirmed that after making that change, evolution would then filter the same spam message to the next filter rule of the same pattern in my list of filters.  The upshot is that it is highly unlikely that the spam is being bcc'd across the domains; and indeed, headers and subject prefixes that would be added by the mailing list(s) in question are not present in the rogue-filtered messages, eliminating that as a possibility.

Comment 1 Milan Crha 2017-05-15 08:18:40 UTC
Thanks for a bug report. Mailing list comparison is semi-complicated, the value being compared is constructed from several headers.

Could you:

a) provide one such spam message (right-click it in the message list and pick
   "Save as mbox..." option)
b) and also the rule which got used to move the spam message into that folder

please? To get the filter rule, ideally open
   ~/.config/evolution/mail/filters.xml
and copy all between <rule ...> and </rule> for that particular rule. The text between <title></title> is what you see in the evolution UI. You can search the file for the value it compares to as well.

Thanks in advance.

Comment 2 Kevin L. Mitchell 2017-05-18 13:24:15 UTC
I just received such a spam today.  The rule being matched is below.  I'll add an attachment with the spam message in a moment.

    <rule enabled="true" grouping="any" source="incoming">
      <title>Undernet mailing lists</title>
      <partset>
        <part name="mlist">
          <value name="mlist-type" type="option" value="contains"/>
          <value name="mlist" type="string" allow-empty="true">
            <string>@undernet.org</string>
          </value>
        </part>
      </partset>
      <actionset>
        <part name="move-to-folder">
          <value name="folder" type="folder">
            <folder uri="folder://1236303557.21310.23%40kev-mobile/INBOX/Undernet"/>
          </value>
        </part>
      </actionset>
    </rule>

Comment 3 Kevin L. Mitchell 2017-05-18 13:25:31 UTC
Created attachment 1280016 [details]
Misfiled spam

Comment 4 Milan Crha 2017-05-19 07:45:53 UTC
Thanks for the update. I can reproduce it with your message and filter too. The problem is the '@' in the rule. A code comment says:

   /* Special mailing list old-version domain hack.
    * If one of the mailing list names doesn't have an @ in it,
    * its old-style, so only match against the pre-domain part,
    * which should be common. */

And your spam massage has:

   List-Id: wf056nt4g93e0 <Ours4>

Then evolution compares "@undernet.org" against "Ours4". There applies the above code comment which results in using pre-domain part for the rule-value, which makes it to compare "" against "Ours4", while an empty string is always contained in anything.

It's a bug in the code, which I fixed with the below change. You can workaround it by removing the '@' in the Message Filters value for that rule (3.22.x is dead for upstream, there is not planned any further update for it).

Created commit b361524 in eds master (3.25.2+) [1]
Created commit 39a0918 in eds gnome-3-24 (3.24.3+)

[1] https://git.gnome.org/browse/evolution-data-server/commit/?id=b361524


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