Bug 293432 - automatic filtering on checking mails does not work
Summary: automatic filtering on checking mails does not work
Status: RESOLVED UNMAINTAINED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: Mail Filter Agent (show other bugs)
Version: 4.10
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-06 10:38 UTC by Barade
Modified: 2018-02-01 09:47 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Barade 2012-02-06 10:38:26 UTC
Version:           4.8 (using KDE 4.8.0) 
OS:                Linux

If I create a new filter with two entries of "List-Id" with different values and checking "Match any of the following" the filter doesn't work or is simply ignored.

Reproducible: Always

Steps to Reproduce:
create a filter as mentioned above


Expected Results:  
Mails should be filtered if they contain at leas one of both entries.
Comment 1 Laurent Montel 2012-02-06 10:41:44 UTC
imap ?
pop3 ?

Type of filters ? (paste config of this filter : or export it in filter dialog box)

Use kmail->tools-> filter log and look at if it catchs or not
Thanks
Comment 2 Barade 2012-02-06 10:47:46 UTC
IMAP,

[Filter #0]
Applicability=0
AutomaticName=false
ConfigureShortcut=false
ConfigureToolbar=false
Enabled=true
Icon=system-run
StopProcessingHere=true
ToolbarName=KDevelop
action-args-0=Username/Inbox/Mailing-Listen/KDevelop
action-name-0=transfer
actions=1
apply-on=check-mail,manual-filtering
contentsA=kdevelop-devel.barney.cs.uni-potsdam.de
contentsB=kdevelop.barney.cs.uni-potsdam.de
fieldA=List-Id
fieldB=List-Id
funcA=contains
funcB=contains
identifier=pnlHSYMeAaIheDVm
name=KDevelop
operator=or
rules=2

[General]
filters=1


They are not being ignored when applying all filters manually!
Comment 3 Barade 2012-09-19 15:03:29 UTC
This bug is still present (4.9.1). It happens to some mails that they're arent filtered correctly. When I apply manual filter (Ctrl+J) they're moved properly.
I have checked "Match any of the following" and given a List-Id. Besides I've checked the default advanced options "Apply this filter to incoming messages", "from all accounts", "Apply this filter on manual filtering" and "If this filter matches stop processing here".
Comment 4 András Manţia 2012-10-13 13:45:34 UTC
Can you enable the filter log widget(Tools-Filter Log) and paste its content when you get a mail that should be filtered, but isn't?
Comment 5 András Manţia 2012-10-13 13:57:58 UTC
Is the account online imap or disconnected?
Comment 6 András Manţia 2012-10-13 14:49:19 UTC
I tried it with POP3 and online IMAP, but cannot reproduce it. Can you test with 4.9.2 and (if possible) with the upcoming akonadi 1.8.1?
Comment 7 Barade 2012-11-17 13:05:42 UTC
This bug is still present in 4.9.2 and with akonadi-server 1.8.1
Filter log:
[13:51:14] 1 = "List-Id" <contains> "crystal-main.lists.sourceforge.net" (CS developers and users list <crystal-main.lists.sourceforge.net>)
[13:51:14] Filter rules have matched.
[13:51:14] Applying filter action: Move Into Folder "Peter/Inbox/Mailing-Listen/Crystal Space"

when applied manually with Ctrl+J, other filters are evaluated with result 0 before.
The rule is:
[Filter #39]
Applicability=0
AutomaticName=false
ConfigureShortcut=false
ConfigureToolbar=false
Enabled=true
Icon=system-run
StopProcessingHere=true
ToolbarName=Crystal Space
action-args-0=Peter/Inbox/Mailing-Listen/Crystal Space
action-name-0=transfer
actions=1
apply-on=check-mail,manual-filtering
contentsA=crystal-main.lists.sourceforge.net
contentsB=crystal-announce.lists.sourceforge.net
fieldA=List-Id
fieldB=List-Id
funcA=contains
funcB=contains
identifier=4MNyLPotyC7Zsfa0
name=Crystal Space
operator=or
rules=2

Currently I am updating to 4.9.3 and going to test it with the latest version.
Comment 8 Barade 2013-10-02 15:54:52 UTC
Filter log says on manual filtering (pressing Ctrl+J):
[17:46:12] Evaluating filter rules: (match any of the following) "List-Id" <contains> "kdevelop-devel.barney.cs.uni-potsdam.de" "List-Id" <contains> "kdevelop.barney.cs.uni-potsdam.de" "List-Id" <contains> "kdevelop.kde.org"
[17:46:12] 0 = "List-Id" <contains> "kdevelop-devel.barney.cs.uni-potsdam.de" (<kdevelop.kde.org>)
[17:46:12] 0 = "List-Id" <contains> "kdevelop.barney.cs.uni-potsdam.de" (<kdevelop.kde.org>)
[17:46:12] 1 = "List-Id" <contains> "kdevelop.kde.org" (<kdevelop.kde.org>)
[17:46:12] Filter rules have matched.

but the message is not filtered automatically!
Initially, I thought it would only occur having two List-Id patterns in one filter (match any of) but it's the same for one single filter having one single statement.
Automatic filtering on checking for new mails does not work.
Maybe the reaction to the event is not handled properly.

This is another filter configuration but this time with only one rule:
[Filter #0]
Applicability=0
AutomaticName=false
ConfigureShortcut=false
ConfigureToolbar=false
Enabled=true
Icon=system-run
StopProcessingHere=true
ToolbarName=CMake
action-args-0=Peter/Inbox/Mailing-Listen/cmake
action-name-0=transfer
actions=1
apply-on=check-mail,manual-filtering
contentsA=cmake.cmake.org
fieldA=List-Id
funcA=contains
identifier=O5aLsYYxI0UfBGEg
name=CMake
operator=or
rules=1

[General]
filters=1

I am using KMail 4.10.5.
Comment 9 Barade 2013-10-02 16:02:39 UTC
This one works all the time:
[Filter #0]
Applicability=0
AutomaticName=true
ConfigureShortcut=false
ConfigureToolbar=false
Enabled=true
Icon=system-run
StopProcessingHere=true
ToolbarName=World of Players
action-args-0=Peter/Inbox/Websites/WorldofPlayers
action-name-0=transfer
actions=1
apply-on=check-mail,manual-filtering
contentsA=@worldofplayers.de
fieldA=From
funcA=contains
identifier=A4vqzxszWerWrSeG
name=World of Players
operator=or
rules=1

[General]
filters=1

I guess "AutomaticName=true" is the only difference. Unfortunately I don't know when this option is set true.
Comment 10 Daniel Vrátil 2013-10-03 08:54:59 UTC
Do you use disconnected IMAP? If not, your problem is caused by bug 295051 (fixed in master/4.12)
Comment 11 András Manţia 2013-10-03 09:41:15 UTC
I'm not sure how that fixes the problem though. This issue is intermittent (yeah, I also see it, but had no time to debug). I'd rather think it is some kind of racing problem in akonadi job handling.
Comment 12 Daniel Vrátil 2013-10-03 09:50:42 UTC
When not using disconnected IMAP, List-Id (and other) headers were not fetched, so the filter could never match them. Manually applying the filter means, that user has to click the email first, so KMail opens it and the entire message with all headers and body is fetched from server - after that the filter works obviously. 

In comment #9 Barade also says, that matching by "From" field works for him, which aligns with the aforementioned bug nicely, since the "From" field is always fetched.
Comment 13 Barade 2014-05-17 13:14:38 UTC
Are you sure that all header fields are fetched when selecting multiple messages in the inbox? It might be the case now (I am not sure) that newly received messages are filtered correctly but whenever I select ALL messages in the Inbox and press "Ctrl+J" only some of them are moved into the correct folders then KMail stops at some point. I use kmail 4.12.5 now. The same for kdepimlibs and akonadi-server 1.11.0. Which packages do I have to upgrade?
Comment 14 stakanov.s 2015-01-22 14:38:44 UTC
I can confirm this here as a regression in Kmail 4.14.3 opensuse packages from 13.2 opensuse . 
Following happens:
if you have several local folders and use pop, and you use filters to put order in incoming messages than you can verify that:
if you have kontact or kmail in the startup folder, you put the kwallet master password when the program asks for it and you do immediately(!) a manual check thereafter of mail or if you have set: check on startup - then the mail will NOT be filtered or will only partially be so,  instead it will stay in the first main folder(s). That is, if I have a folder local, with identity A, identity B and identity C, the mails of the identities are correctly left in the main folders (e.g. A, B and C), but then no subfiltering is done. So the mail is not distributed to subfolders.  If now you choose in menu-folders-apply all filters to a folder, all messages will now be correctly filtered to the respective sub-folders. This applies especially (but not exclusively) to mailing-list filters.

If you have the same set-up and you wait for let us say about a minute before doing any mail-check filter will instead work correctly. 

If you have done so (you waited) and your filters work correctly and you have a multi-user system, when you "switch session" and then you work for some time in another user and then you switch session again back to the mail,  you will find in a 50 percent of cases that if mail has arrived the same error is presenting, that is mail is put all together cluttered in the respective personality filter but no sub-filtering occurs.  If you now apply the manual filter all works. But automatic filtering will work only, for that session,  if you do close kmail/kontakt and restart the program. You do not have, however, to log in and out the user. That is AFAIK not necessary. 

This error is somewhat a regression from previous versions and was more evident when we switched to Baloo. Then it was fixed and now, for some reason, it reappears.
Comment 15 Denis Kurz 2017-06-23 20:02:02 UTC
This bug has never been confirmed for a KDE PIM version that is based on KDE Frameworks (5.x). Those versions differ significantly from the old 4.x series. Therefore, I plan to close it in around two or three months. In the meantime, it is set to WAITINGFORINFO to give reporters the oportunity to check if it is still valid. As soon as someone confirms it for a recent version (at least 5.1, ideally even more recent), I'll gladly reopen it.

Please understand that we lack the manpower to triage bugs reported for versions almost two years beyond their end of life.
Comment 16 Denis Kurz 2018-02-01 09:47:17 UTC
Just as announced in my last comment, I close this bug. If you encounter it again in a recent version (at least 5.1 aka 15.12; preferably much more recent), please open a new one unless it already exists. Thank you for all your input.