Bug 339090 - Filters on mailing lists get confused if the mail has more recipients
Summary: Filters on mailing lists get confused if the mail has more recipients
Status: RESOLVED FIXED
Alias: None
Product: kmail2
Classification: Applications
Component: commands and actions (show other bugs)
Version: 4.14.0
Platform: Debian unstable Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-15 06:43 UTC by Salvo "LtWorf" Tomaselli
Modified: 2014-09-19 22:16 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.14.2


Attachments
Filter (594 bytes, text/plain)
2014-09-17 09:52 UTC, Salvo "LtWorf" Tomaselli
Details
mail which was not filtered correctly (3.44 KB, application/mbox)
2014-09-18 00:50 UTC, Shai
Details
the filter I tried to apply (851 bytes, text/plain)
2014-09-18 00:51 UTC, Shai
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Salvo "LtWorf" Tomaselli 2014-09-15 06:43:49 UTC
When I get an email from a mailing list, if might often contain some addresses in Cc, or even have the mailing list in Cc and someone else in To.

In these cases, despite me not being in To or Cc (I'm getting the mail through the mailing list), the filter fails to work and leaves the mail in the inbox.

Reproducible: Always
Comment 1 Shai 2014-09-16 20:21:25 UTC
This was first reported as a Debian bug - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=761252

Additional info I have posted there:

Filter processing fails to read the "List-Id" header. I see messages with
list-ids, and the Filter Log Viewer shows the relevant rule not
matched because the List-Id header is (falsely) empty.

I also see the "From" header reported as empty by the filters,
but the "X-Spambayes-Classification" header -- added by another
filter -- is read correctly.
Comment 2 Laurent Montel 2014-09-17 09:46:01 UTC
could you attach here a example mail (as mbox) and write which type of filter do you use please.
I need it to try to reproduce it.
Comment 3 Salvo "LtWorf" Tomaselli 2014-09-17 09:52:44 UTC
Created attachment 88719 [details]
Filter

conditions B and C were added by me at a later time to make the filter work in more cases
Comment 4 Salvo "LtWorf" Tomaselli 2014-09-17 09:56:46 UTC
This is an email that wasn't filtered, creating only a filter on the mailing list.

As I understand, the problem is that I received the message directly, and not from the list. But it's often common practice to reply like this.


Return-Path: <tomaz.canabrava@gmail.com>
X-Original-To: salvo@localhost
Delivered-To: salvo@localhost
Received: from computerazzo3 (localhost [127.0.0.1])
	by computerazzo3 (Postfix) with ESMTP id C924B5140058
	for <salvo@localhost>; Thu,  4 Sep 2014 15:07:04 +0000 (UTC)
Received: from pop.tiscali.it [213.205.33.10]
	by computerazzo3 with POP3 (fetchmail-6.3.21)
	for <salvo@localhost> (single-drop); Thu, 04 Sep 2014 15:07:04 +0000 (UTC)
Received: from imp-2.mail.tiscali.it (10.39.115.249) by mx-3-it.mail.tiscali.it (8.5.149)
        id 53FC61210242A3B7 for tiposchi@tiscali.it; Thu, 4 Sep 2014 17:02:56 +0200
Received: from mail-we0-f182.google.com ([74.125.82.182])
	by imp-2.mail.tiscali.it with 
	id n32w1o00M3w1P8y0132wBF; Thu, 04 Sep 2014 17:02:56 +0200
x-cnfs-analysis: v=2.1 cv=Xrl0OD19 c=1 sm=2 tr=0
 a=c6bX2p+Ce+PLPcvS8gMg2w==:117 a=1XWaLZrsAAAA:8 a=5EptbeDkmwsA:10
 a=sn3mE_UUSjoA:10 a=HCgibljzlTMA:10 a=3fyaaF4VAAAA:8 a=pGLkceISAAAA:8
 a=0nibGUrJAAAA:8 a=xY3W0DUrAAAA:8 a=ghOrB88r1J1KzgOv6CEA:9 a=QEXdDO2ut3YA:10
 a=WArk0sYntmEA:10 a=u2Ob1EsM8-ZENmkYDJYA:9 a=_C67OigbziIlAumb:21
 a=tXsnliwV7b4A:10 a=lt2zckDBThsA:10
X-Tiscali-SPF-Pass: TRUE
Received: by mail-we0-f182.google.com with SMTP id w62so10332358wes.13
        for <tiposchi@tiscali.it>; Thu, 04 Sep 2014 08:02:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:sender:in-reply-to:references:date:message-id:subject
         :from:to:cc:content-type;
        bh=WXixwRbKW4oEnQLBHif4JpqKqqHPmxWWfEVO62aZWWg=;
        b=0mAEhgp88G0rZEEb+ulXAtbWNi5W33ev7YkAAlUolTNp2saQWFriVZ9O037rzH59sc
         4JisEuqTU4W3s6wlepPOIkOAJGyqjXmdy80m7tN34esdnDK+3oN7Rao53AoOQwvKGrP7
         oSKk4c8foiIo6eoH6Wgy7VVrBd/aWOW+X4q2HBMdT3iP7G9e/bzNpWpDRnpymC0kA5PP
         rJrH8knjDpykpe2uLq4gedeP/ty0NHxcJKc7MypLvL7y+u83N/M6yl84bkPOnzqi9AXl
         eH43HuSmngyEpBN26C9h5SL5uFmTRaFWoh/nGKFn9v7habk4uN7j1KeSGmuguvvc975t
         YCiA==
MIME-Version: 1.0
X-Received: by 10.194.6.101 with SMTP id z5mr6930058wjz.79.1409842975737; Thu,
 04 Sep 2014 08:02:55 -0700 (PDT)
Sender: tomaz.canabrava@gmail.com
Received: by 10.216.47.9 with HTTP; Thu, 4 Sep 2014 08:02:55 -0700 (PDT)
Received: by 10.216.47.9 with HTTP; Thu, 4 Sep 2014 08:02:55 -0700 (PDT)
In-Reply-To: <42750370.krd9mdVhnV@hal9000>
References: <53FCA8A9.6000803@zoology.up.ac.za>
	<20140826173914.GD4245@rrmbp.gr8dns.org>
	<42750370.krd9mdVhnV@hal9000>
Date: Thu, 4 Sep 2014 12:02:55 -0300
X-Google-Sender-Auth: elDoHfhmaHCEhOr93FkJafK23gk
Message-ID: <CACk01_yXNDLd4b8Mt9oDPL-ur+dp32Hk4R5JJyjxY6gi_OuRvg@mail.gmail.com>
Subject: Re: [CCR PATCH] Create memory space for CCR gas pressures (part 2)
From: Tomaz Canabrava <tcanabrava@kde.org>
To: Salvo Tomaselli <tiposchi@tiscali.it>
Cc: Subsurface Mailing List <subsurface@hohndel.org>
Content-Type: multipart/alternative; boundary=047d7b5d42cec20cf705023ea500

 
--047d7b5d42cec20cf705023ea500
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Comment 5 Laurent Montel 2014-09-17 17:17:53 UTC
"As I understand, the problem is that I received the message directly, and not from the list. But it's often common practice to reply like this." so it's not a bug from filter about list no ?

And I need a real email for testing it not a copy/paste.
"kmail->save as->foo.mbox"

thanks
Comment 6 Shai 2014-09-18 00:50:09 UTC
Created attachment 88734 [details]
mail which was not filtered correctly

Hi,
This is the automatic message I got for your latest comment on this bug.
It was supposed to go into the "kde-devel" folder, because it comes from the KDE bugzilla. But even trying to apply the filter manually, I get these results (pasted from Filter Log Viewer)

[03:38:37] Evaluating filter rules: (match any of the following) "List-Id" <contains> "<kde-devel.kde.org>" "List-Id" <contains> "<kde-il.yahoogroups.com>" "X-Bugzilla-URL" <contains> "http://bugs.kde.org/" "List-Id" <contains> "<heb-bugzap.projects.hamakor.org.il>" "List-Id" <contains> "<kde-pim.kde.org>"
[03:38:37] 0 = "List-Id" <contains> "<kde-devel.kde.org>" ()
[03:38:37] 0 = "List-Id" <contains> "<kde-il.yahoogroups.com>" ()
[03:38:37] 0 = "X-Bugzilla-URL" <contains> "http://bugs.kde.org/" ()
[03:38:37] 0 = "List-Id" <contains> "<heb-bugzap.projects.hamakor.org.il>" ()
[03:38:37] 0 = "List-Id" <contains> "<kde-pim.kde.org>" ()

Note how in the log, the headers all appear empty. X-Bugzilla-URL, specifically, looks fine in the message itself. Exported filter will be added shortly.
Comment 7 Shai 2014-09-18 00:51:19 UTC
Created attachment 88735 [details]
the filter I tried to apply
Comment 8 Laurent Montel 2014-09-18 13:49:16 UTC
I don't understand your email attached. It can't be filter with your filter.
"contentsA=<kde-devel.kde.org>
contentsB=<kde-il.yahoogroups.com>
contentsC=http://bugs.kde.org/
contentsD=<heb-bugzap.projects.hamakor.org.il>
contentsE=<kde-pim.kde.org>
fieldA=List-Id
fieldB=List-Id
fieldC=X-Bugzilla-URL
fieldD=List-Id
fieldE=List-Id
"
I don't see it in your email.
So it's normal this filter doesn't work :)
Comment 9 Shai 2014-09-18 19:59:35 UTC
The X-Bugzilla-URL header which should have matched rule C is at line 61 in the file.
Comment 10 Laurent Montel 2014-09-19 06:39:28 UTC
Ah ok see.
And fixed bug.
it works fine now here.
Comment 11 Laurent Montel 2014-09-19 06:40:23 UTC
Git commit 9614da012753032a89014c65fd89bd1daae4a467 by Montel Laurent.
Committed on 19/09/2014 at 06:39.
Pushed by mlaurent into branch 'KDE/4.14'.

Fix Bug 339090 - Filters on mailing lists get confused if the mail has more recipients

FIXED-IN: 4.14.2

M  +17   -2    mailcommon/search/searchpattern.cpp

http://commits.kde.org/kdepim/9614da012753032a89014c65fd89bd1daae4a467
Comment 12 Shai 2014-09-19 22:16:25 UTC
Thanks for the quick fix.