Bug 292497 - kmail 4.8.0 doesn't filter the incoming messages
Summary: kmail 4.8.0 doesn't filter the incoming messages
Status: RESOLVED FIXED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: Mail Filter Agent (show other bugs)
Version: GIT (master)
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-26 18:59 UTC by Sascha Manns
Modified: 2013-03-07 06:42 UTC (History)
18 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.10.1


Attachments
Mail that slipped though filter (6.43 KB, text/plain)
2012-01-28 17:26 UTC, Thomas Tanghus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sascha Manns 2012-01-26 18:59:53 UTC
Version:           4.8 (using Devel) 
OS:                Linux

The present version 4.8.0 of KMail doesn't filter the incoming messages. Just manual filtering works. Other ppl can reproduce this too (see Additional Information).

Reproducible: Always

Steps to Reproduce:
Just start KMail and wait what happens after fetching new messages.

Actual Results:  
No filtering

Expected Results:  
Filtering :-D

http://lists.kde.org/?l=kdepim-users&m=132760202431272&w=2
Comment 1 Russ Fineman 2012-01-26 19:32:58 UTC
I also see this on openSUSE 12.1, KDE 4.8.0. I get the following error message:

Kmail 4.8.0 getting a lot of "Unknown Error (No Item Found)"Messages. Error applying mail filter move~. Retrieving email from POP3 server. 

On the Akonadi Console under Agents I See the following:

Code
.........
The name org.freedesktop.Akonadi.Resource.akonadi_mailfilter_agent was not 
provided by any .service files

/Code
..........
Not sure if this is a problem.
Comment 2 Thomas Tanghus 2012-01-26 19:51:53 UTC
Confirmed on Kubuntu 11.10 with KDE SC 4.8 installed from Kubuntu backports ppa.
Comment 3 Laurent Montel 2012-01-27 17:15:16 UTC
Works fine
need more info.
Imap ? pop3 ? which type of filter ? (paste infos) etc.
Comment 4 Thomas Tanghus 2012-01-27 17:43:55 UTC
For me an IMAP account from a Courier server. Some messages do get filtered, others not. No recognizable pattern. I've just enabled the filter log, so no info yet.
I believe Sascha has both POP and IMAP.
Comment 5 Thomas Tanghus 2012-01-27 17:48:58 UTC
Here's an example of a mail that didn't get filtered automatically, but only when I manually applied all filters:

[18:44:06] Evaluating filter rules: (match all of the following) "List-Id" <contains> "<kde-buildsystem.kde.org>"
[18:44:06] 0 = "List-Id" <contains> "<kde-buildsystem.kde.org>" ()
[18:44:06] Evaluating filter rules: (match all of the following) "List-Post" <contains> "<mailto:bug-control@bugs.kde.org>"
[18:44:06] 1 = "List-Post" <contains> "<mailto:bug-control@bugs.kde.org>" (<mailto:bug-control@bugs.kde.org>)
[18:44:06] Filter rules have matched.
[18:44:06] Applying filter action: Move Into Folder "108"
Comment 6 Laurent Montel 2012-01-27 17:52:44 UTC
imap doesn't work for filter + header.
Comment 7 Thomas Tanghus 2012-01-27 18:24:47 UTC
(In reply to comment #6)
> imap doesn't work for filter + header.

It did until yesterday.
Comment 8 Sascha Manns 2012-01-27 19:04:39 UTC
In my case it is IMAP and POP3 mails. But i've seen, that 3 or 4 messages per polling are getting filtered. But the most not.
Can i provide more informative things? Log etc...?
Comment 9 Russ Fineman 2012-01-27 19:30:32 UTC
In my case it filters some but not all ( this morning 208) messages were not filtered). I usually filter on Subject, To: or From:. If I look at Akonadiconsole the Mail Filter Agent Shows as Ready.

get error message Unknown error. (No items found)

Top Line of error box shows:Error applying Mail Filter Move-

If I answer the message I sometimes Get additional Error message:
Unknown error. (NO ImapParserException: Unable to read more data
)

Top Line of error box shows: Error applying mail Filter modifications - Mail Filter Agent

My mail server is a POP3, I don't use IMAP.

Get alot of errors in Akonadiconsole debugger:

Code
.........

akonadi_mailfilter_agent (0x87d610) X-Bugzilla-Status: BAD Unrecognized command: UNCONFIRMED 
akonadi_mailfilter_agent (0x87d610) X-Bugzilla-Priority: NOR X-Bugzilla-Assigned-To: kdepim-bugs@kde.org X-Bugzilla-Target-Milestone: --- In-Reply-To: <bug-292497-45513@http.bugs.kde.org/> References: <bug-292497-45513@http.bugs.kde.org/> Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 X-pstn-levels: (S:99.90000/99.90000 CV:99.9000 FC:95.5390 LC:95.5390 R:95.9108 P:95.9108 M:97.0282 C:98.6951 ) X-pstn-settings: 5 (2.0000:2.0000) s cv gt3 gt2 gt1 r p m c X-pstn-addresses: from <Sascha.Manns@open-slx.de> [751/34] X-MagicMail-UUID: c410098c-4919-11e1-961a-005056af0017 PLD:ENVELOPE[1] {388} 237 UID MOVE 38447 25 
akonadi_mailfilter_agent (0x87d610) X-Bugzilla-Priority: BAD Unrecognized command: NOR 
akonadi_mailfilter_agent (0x87d610) X-Bugzilla-Assigned-To: kdepim-bugs@kde.org X-Bugzilla-Target-Milestone: --- In-Reply-To: <bug-292497-45513@http.bugs.kde.org/> References: <bug-292497-45513@http.bugs.kde.org/> Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 X-pstn-levels: (S:99.90000/99.90000 CV:99.9000 FC:95.5390 LC:95.5390 R:95.9108 P:95.9108 M:97.0282 C:98.6951 ) X-pstn-settings: 5 (2.0000:2.0000) s cv gt3 gt2 gt1 r p m c X-pstn-addresses: from <Sascha.Manns@open-slx.de> [751/34] X-MagicMail-UUID: c410098c-4919-11e1-961a-005056af0017 PLD:ENVELOPE[1] {388} 237 UID MOVE 38447 25 
akonadi_mailfilter_agent (0x87d610) X-Bugzilla-Assigned-To: BAD Unrecognized command: kdepim-bugs@kde.org 

/Code
...........

Let me know if I can provide more information

Thanks.
Comment 10 S. Burmeister 2012-01-28 10:08:00 UTC
bug 292283 has some more information. I can confirm that this happens only with filters checking for headers. Those that check for subject do work.
Comment 11 Sascha Manns 2012-01-28 11:39:50 UTC
Yes that i can confirm too. Anything like "List-id" doesn't work.
Comment 12 Thomas Tanghus 2012-01-28 17:12:54 UTC
I've just had several that slipped through a CC filter:

[17:56:53] Evaluating filter rules: (match all of the following) "List-Post" <contains> "<mailto:bug-control@bugs.kde.org>"
[17:56:53] 0 = "List-Post" <contains> "<mailto:bug-control@bugs.kde.org>" ()
[17:56:53] Evaluating filter rules: (match all of the following) "List-Id" <contains> "<plone-users.lists.sourceforge.net>"
[17:56:53] 0 = "List-Id" <contains> "<plone-users.lists.sourceforge.net>" ()
[17:56:53] Evaluating filter rules: (match all of the following) "List-Id" <contains> "<kde-bindings.kde.org>"
[17:56:53] 0 = "List-Id" <contains> "<kde-bindings.kde.org>" ()
[17:56:53] Evaluating filter rules: (match all of the following) "From" <contains> "noreply@statusnetondemand.net"
[17:56:53] 0 = "From" <contains> "noreply@statusnetondemand.net" (Facebook <update+ky4yw52n@facebookmail.com>)
[17:56:53] Evaluating filter rules: (match any of the following) "CC" <contains> "kde-pim@kde.org"
[17:56:53] 0 = "CC" <contains> "kde-pim@kde.org" ()

I have now changed the filter to 'all' instead of any to see what happens.
Comment 13 Thomas Tanghus 2012-01-28 17:26:12 UTC
Created attachment 68275 [details]
Mail that slipped though filter

(In reply to comment #12)
> I have now changed the filter to 'all' instead of any to see what happens.

Which didn't help:

[18:16:40] Evaluating filter rules: (match any of the following) "CC" <contains> "kde-pim@kde.org"
[18:16:40] 0 = "CC" <contains> "kde-pim@kde.org" ()
Comment 14 Xavier Claude 2012-01-30 20:36:53 UTC
I've got the same here on Gentoo. The filters on list doesn't work but those on  From: seems to work.
Comment 15 Andrew Gaydenko 2012-01-30 23:39:24 UTC
Besides already mentioned https://bugs.kde.org/show_bug.cgi?id=292283 bug this one

https://bugs.kde.org/show_bug.cgi?id=283548

seems to be also related (moving a message works sometimes only for 4.8). Probably all issues can be merged, and summing bug set as NEW, can't they?
Comment 16 Russ Fineman 2012-02-12 00:02:34 UTC
*** This bug has been confirmed by popular vote. ***
Comment 17 jmaldrich 2012-06-23 15:02:43 UTC
I'm having this problem as well. I can *manually* filter after POP-ing my email, but only after it's sitting in my inbox can I filter it. I have to manually select all the new email and then hit CTL+J to apply filters. My filters are all set to filter on my primary POP3 account and filter it into various folders. As I say, it works fine when I manually apply the filters, but that takes time and massive amounts of CPU cycles as I only POP my email every few days. Most email I read via IMAP and then POP two or three times a week, so I have a LOT of email built up.
I was advised that this was resolved in 4.8. I am now using KMail 4.8.3, on KDE 4.8.3, Fedora 17. Please fix this, as I would very much like to have my filters operating as they should.
Comment 18 juha.heljoranta 2012-07-24 13:12:40 UTC
I think I managed to find a "workaround" for this.

Problem seems to relate to message retrieval options. Filtering works only if the message retrieval is "Always retrieve full messages". There seems to be a bug which reverts message retireval to ondemand every time I click "Check Mail". I _think_ I managed to fix the issue by checking "Use options from parent folder or account". The check box setting doesn't persit for some reason (hey, another bug! :) However, this caused the "Always retrieve full messages" to activate and stay activated.
Comment 19 jmaldrich 2012-07-24 14:09:50 UTC
The "workaround" will not work on POP3, which is what I use. :(
Comment 20 András Manţia 2012-07-24 14:25:36 UTC
pop3 downloads the mails in maildir/mixedmaildir and that has the same option there, you can give it a try.
Comment 21 S. Burmeister 2012-07-24 15:25:19 UTC
(In reply to comment #18)
> Problem seems to relate to message retrieval options. Filtering works only
> if the message retrieval is "Always retrieve full messages".

I can confirm this. Whereas before only filters working on the subject worked, List-Post header filters etc. work now as well. (kdepim 4.8.4)

> There seems to
> be a bug which reverts message retireval to ondemand every time I click
> "Check Mail". I _think_ I managed to fix the issue by checking "Use options
> from parent folder or account". The check box setting doesn't persit for
> some reason (hey, another bug! :) However, this caused the "Always retrieve
> full messages" to activate and stay activated.

MY experience here differs a bit. If you open the top-folder's properties, i.e. the "account folder's" and set "it to "always retrieve full email" it will not stick.
If one unchecks "use parent folder's settings" e.g. for the inbox folder and enables "always retrieve full email" it does stick.

Did you file a bug yet about the setting not sticking?
Comment 22 juha.heljoranta 2012-07-24 19:27:04 UTC
(In reply to comment #21)
> Did you file a bug yet about the setting not sticking?
Done: #304024
Comment 23 Thomas Tanghus 2012-07-25 12:44:10 UTC
(In reply to comment #21)
> MY experience here differs a bit. If you open the top-folder's properties,
> i.e. the "account folder's" and set "it to "always retrieve full email" it
> will not stick.
> If one unchecks "use parent folder's settings" e.g. for the inbox folder and
> enables "always retrieve full email" it does stick.

I experience the exact opposite. On my inbox I now have "use parents settings", and on the account folder "always retrieve full email", and for the first time in months my mail also get filtered on list-id etc. 

But thanks juha for coming up with this workaround. My inbox used to be quite unmanageable if I was away for just a day or so ;)

KMail 4.8.2 btw..
Comment 24 Ivan Čukić 2012-08-22 09:32:14 UTC
Confirming it doesn't work in master. Doing Ctrl-A Ctrl-J all the time when I enter my inbox.

Here's my filter log - first part is automatic, second is manual filter

I'm using offline IMAP

------------------------------
[11:22:38] Evaluating filter rules: (match all of the following) "From" <contains> "alas.matf.bg.ac.rs"
[11:22:38] 0 = "From" <contains> "alas.matf.bg.ac.rs" (Christian Mollekopf <chrigi_1@fastmail.fm>)
[11:22:38] Evaluating filter rules: (match any of the following) "To" <contains> "ivan@matf.bg.ac.rs" "To" <contains> "ivan@math.rs" "From" <contains> "@matf.bg.ac.rs"
[11:22:38] 0 = "To" <contains> "ivan@matf.bg.ac.rs" (nepomuk@kde.org)
[11:22:38] 0 = "To" <contains> "ivan@math.rs" (nepomuk@kde.org)
[11:22:38] 0 = "From" <contains> "@matf.bg.ac.rs" (Christian Mollekopf <chrigi_1@fastmail.fm>)
[11:22:38] Evaluating filter rules: (match any of the following) "To" <contains> "iv.ancukic@gmail.com" "To" <contains> "i.vancukic@gmail.com"
[11:22:38] 0 = "To" <contains> "iv.ancukic@gmail.com" (nepomuk@kde.org)
[11:22:38] 0 = "To" <contains> "i.vancukic@gmail.com" (nepomuk@kde.org)
[11:22:38] Evaluating filter rules: (match all of the following) "List-Id" <contains> "kde-ev-membership.kde.org"
[11:22:38] 0 = "List-Id" <contains> "kde-ev-membership.kde.org" ()
[11:22:38] Evaluating filter rules: (match all of the following) "X-ReviewBoard-URL" <contains> "http://git.reviewboard.kde.org"
[11:22:38] 0 = "X-ReviewBoard-URL" <contains> "http://git.reviewboard.kde.org" ()
[11:22:38] Evaluating filter rules: (match any of the following) "X-Bugzilla-Assigned-To" <contains> "kde.org" "Reply-To" <contains> "bugs.kde.org"
[11:22:38] 0 = "X-Bugzilla-Assigned-To" <contains> "kde.org" ()
[11:22:38] 0 = "Reply-To" <contains> "bugs.kde.org" ()
[11:22:38] Evaluating filter rules: (match all of the following) "List-Id" <contains> "kde.org"
[11:22:38] 0 = "List-Id" <contains> "kde.org" ()
------------------------------
[11:27:29] Evaluating filter rules: (match all of the following) "From" <contains> "alas.matf.bg.ac.rs"
[11:27:29] 0 = "From" <contains> "alas.matf.bg.ac.rs" (Christian Mollekopf <chrigi_1@fastmail.fm>)
[11:27:29] Evaluating filter rules: (match any of the following) "To" <contains> "ivan@matf.bg.ac.rs" "To" <contains> "ivan@math.rs" "From" <contains> "@matf.bg.ac.rs"
[11:27:29] 0 = "To" <contains> "ivan@matf.bg.ac.rs" (nepomuk@kde.org)
[11:27:29] 0 = "To" <contains> "ivan@math.rs" (nepomuk@kde.org)
[11:27:29] 0 = "From" <contains> "@matf.bg.ac.rs" (Christian Mollekopf <chrigi_1@fastmail.fm>)
[11:27:29] Evaluating filter rules: (match any of the following) "To" <contains> "iv.ancukic@gmail.com" "To" <contains> "i.vancukic@gmail.com"
[11:27:29] 0 = "To" <contains> "iv.ancukic@gmail.com" (nepomuk@kde.org)
[11:27:29] 0 = "To" <contains> "i.vancukic@gmail.com" (nepomuk@kde.org)
[11:27:29] Evaluating filter rules: (match all of the following) "List-Id" <contains> "kde-ev-membership.kde.org"
[11:27:29] 0 = "List-Id" <contains> "kde-ev-membership.kde.org" (The Semantic KDE <nepomuk.kde.org>)
[11:27:29] Evaluating filter rules: (match all of the following) "X-ReviewBoard-URL" <contains> "http://git.reviewboard.kde.org"
[11:27:29] 0 = "X-ReviewBoard-URL" <contains> "http://git.reviewboard.kde.org" ()
[11:27:29] Evaluating filter rules: (match any of the following) "X-Bugzilla-Assigned-To" <contains> "kde.org" "Reply-To" <contains> "bugs.kde.org"
[11:27:29] 0 = "X-Bugzilla-Assigned-To" <contains> "kde.org" ()
[11:27:29] 0 = "Reply-To" <contains> "bugs.kde.org" ()
[11:27:29] Evaluating filter rules: (match all of the following) "List-Id" <contains> "kde.org"
[11:27:29] 1 = "List-Id" <contains> "kde.org" (The Semantic KDE <nepomuk.kde.org>)
[11:27:29] Filter rules have matched.
[11:27:29] Applying filter action: Move Into Folder "ivan.cukic/KDE"
Comment 25 András Manţia 2012-10-13 13:55:42 UTC
KDE 4.9.2 with the (yet unreleases) akonadi 1.8.1 or akonadi master should retrieve the items correctly for filtering and in case it fails should show better error message. Can you try with that?
Ivan, as I understand the first log is the log when the mail appears in the folder, while the second when you apply the filter manually for the same mail?
Comment 26 jmaldrich 2012-10-13 14:41:50 UTC
On Sat October 13 2012 1:55:42 PM you wrote:
> https://bugs.kde.org/show_bug.cgi?id=292497
> 
> --- Comment #25 from András Manţia <amantia@kde.org> ---
> KDE 4.9.2 with the (yet unreleases) akonadi 1.8.1 or akonadi master should
> retrieve the items correctly for filtering and in case it fails should show
> better error message. Can you try with that?
> Ivan, as I understand the first log is the log when the mail appears in the
> folder, while the second when you apply the filter manually for the same
> mail?
>
Will try it when it's available for Fedora.
Comment 27 Darin McBride 2013-02-08 18:27:42 UTC
I'm getting this problem now with KDE 4.10.0 / akonadi 1.9.0, whereas I didn't get this with KDE 4.9.5 / akonadi 1.8.1.  The only filter that is being automatically applied is the "spam" filter, except that it is ALWAYS putting EVERYTHING into my trash, not just stuff that is actually spam.  (I've turned that off for now.  At least disabling a filter still works.)
Comment 28 dcg 2013-02-21 20:25:53 UTC
I have been hitting this problem (POP3 account) over more than a year, still happens with the latest version.
Comment 29 András Manţia 2013-02-28 08:23:15 UTC
Fixed in KDE 4.10.1 and later by Wolfgang Rohdewald.
http://commits.kde.org/kdepim/185c572e079ef40bee2225e582c11dbdbb35840f
Comment 30 Adrián Chaves (Gallaecio) 2013-03-03 09:18:04 UTC
Verified running 4.10.1.
Comment 31 Adrián Chaves (Gallaecio) 2013-03-06 21:23:56 UTC
Actually, no. The list filter works, yes. However, I must trigger it manually, it won’t work on new emails… Can anyone else confirm this unexpected behavior in KMail 4.10.1?
Comment 32 Russ Fineman 2013-03-06 23:21:31 UTC
On Wednesday, March 06, 2013 09:23:56 PM Adrián Chaves Fernández wrote:
> https://bugs.kde.org/show_bug.cgi?id=292497
> 
> --- Comment #31 from Adrián Chaves Fernández <adriyetichaves@gmail.com> ---
> Actually, no. The list filter works, yes. However, I must trigger it
> manually, it won’t work on new emails… Can anyone else confirm this
> unexpected behavior in KMail 4.10.1?
I am using KDE4.19.1 and kmail filters appear to be working, including filtering all arriva 
messages except yours. probable because I do not have a filter on the subjuct or the 
To filed you used.

Russ
Comment 33 Adrián Chaves (Gallaecio) 2013-03-07 06:42:44 UTC
Messages from Bugzilla with the Akonadi product don’t go to a mailing list, so it’s normal that you cannot filter them according to the mailing list.

However, I’m subscribed to kde-imaging@kde.org, which gets all the related mails from Bugzilla. I have the following filter:

List-Id contains <kde-imaging.kde.org>; move to […]

Now, the rest of my filters affect new messages as they get, and move them to different folders. However, new kde-imaging mails stay in the inbox folder.

On the other hand, if I manually select the emails, right-click and select “Apply a Filter → Apply All Filters”, they are successfully moved to the folder.

Is there anything needed for the fix to take effect other than upgrading? (e.g. removing some configuration)