Bug 282063 - kmail2 - filters don't work on local maildir
Summary: kmail2 - filters don't work on local maildir
Status: RESOLVED FIXED
Alias: None
Product: kmail2
Classification: Applications
Component: filtering (show other bugs)
Version: 4.7
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-15 08:43 UTC by hemathor
Modified: 2013-07-09 22:49 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.10.1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hemathor 2011-09-15 08:43:45 UTC
Version:           4.7 (using KDE 4.7.1) 
OS:                Linux

kmail doesn't filter messages from local maildir folder any more (used to work fine in older versions of kmail).

applying filters manually (e.g. ctrl-j) works fine.

Reproducible: Always

Steps to Reproduce:
add a local maildir account

Actual Results:  
no message is filtered upon receiving

Expected Results:  
messages should be filtered
Comment 1 Laurent Montel 2011-09-16 08:17:31 UTC
Are you sure that your filter is ok ? look at in filter dialog box and look at if filter is ok (destination folder etc.)
Comment 2 hemathor 2011-09-16 09:36:05 UTC
i am pretty sure... otherwise ctrl-j wouldn't work either, would it?

a typical filter looks like this (from kmail2rc):

[Filter #0]
Applicability=2
AutomaticName=true
ConfigureShortcut=true
ConfigureToolbar=false
Icon=
StopProcessingHere=true
ToolbarName=Cron: fetchmail
accounts-set=akonadi_maildir_resource_2
action-args-0=342
action-name-0=transfer
actions=1
apply-on=check-mail,manual-filtering
contentsA=Cron <hemathor@linux> fetchmail -N -d0 --nosyslog -v -f /home/hemathor/.fetchmailrc
contentsB=fetchmail: normal termination, status\s
contentsC=Query status=3 (AUTHFAIL)
fieldA=Subject
fieldB=<body>
fieldC=<body>
funcA=contains
funcB=contains
funcC=contains-not
name=Cron: fetchmail
operator=and
rules=3
Comment 3 Tobias Koenig 2011-09-17 21:13:11 UTC
Hej,

can you check with the 'Tools -> Filter Log Viewer...' dialog what exactly is going on there, please?

Ciao,
Tobias
Comment 4 hemathor 2011-09-18 08:30:52 UTC
hey,

after retrieval of messages, the log is empty, which is not really surprising, since the filters are not applied (as i mentioned above).

manually applying the filters (which works, as i also mentioned above) results in the following log entry:

[10:09:20] Evaluating filter rules: (match all of the following) "Subject" <contains> "Cron <hemathor@linux> fetchmail -N -d0 --nosyslog -v -f /home/hemathor/.fetchmailrc" "<body>" <contains> "fetchmail: normal termination, status " "<body>" <contains-not> "Query status=3 (AUTHFAIL)"
[10:09:20] 1 = "Subject" <contains> "Cron <hemathor@linux> fetchmail -N -d0 --nosyslog -v -f /home/hemathor/.fetchmailrc" (Cron <hemathor@linux> fetchmail -N -d0 --nosyslog -v -f /home/hemathor/.fetchmailrc)
[10:09:20] 1 = "<body>" <contains> "fetchmail: normal termination, status "
[10:09:20] 1 = "<body>" <contains-not> "Query status=3 (AUTHFAIL)"
[10:09:20] Filter rules have matched.

again (since i have a feeling, that there is a misunderstanding):
- i am not saying, that filters don't work, once they are applied. they actually do.
- i am saying, that filters are not applied automatically after retrieving messages from a local maildir. maybe i didn't emphasize this strong enough...

thx for looking into this...
Comment 5 Piotr Keplicz 2011-10-10 18:25:49 UTC
Got similar problem with KMail 4.7.2. I have an IMAP account defined with sent mail saved to a local folder. I set up filters to distribute this mail to proper folders, but it doesn't seem to work ever since I upgraded to KMail2 from KMail1 4.4.10. 

Manually applying the filter with Ctrl+J in the "sent-mail" folder works. When sending mail - filters don't work, there's no info in the log either.
Comment 6 Johannes Rohrer 2011-10-21 10:44:59 UTC
The same problem appears here (version 4.7.2 on Ubuntu 11.10) with a local MBox file.

While filters work fine and automatically for incoming messages from a number of POP3 accounts, they need to be triggered manually when new messages appear in the local mail folder.
Comment 7 Darin McBride 2011-11-02 22:46:20 UTC
I've got the same issue.  And the Filter Log Viewer is showing nothing, nada.

To replicate, configure your MTA (e.g., postfix) to deposit directly into your inbox.  When something comes in, even if you have to send it yourself, notice that the check-mail button doesn't do anything, but if you right-click on the folder and hit refresh, it shows up. No filtering happens.

(Can we remove the "waitingforinfo" tag?)
Comment 8 András Manţia 2011-12-06 15:17:50 UTC
I'd be glad if any of those having a problem could try the upcoming KDE 4.8 beta2 and see if it is still reproducible there. Filtering changed a lot in 4.8, now it is now inside KMail and bugs were fixed along, so it might have fixed this issue (at least I can't see anymore, while I did see it in the past).
Comment 9 Darin McBride 2011-12-13 00:09:47 UTC
I've installed KDE SC 4.7.90, including kdepim at that level.  And not only do I not see my portage emails (delivered via postfix) being filtered into the appropriate folder, but my "spam" button on the top of the screen doesn't want to move messages into the trash folder, either.
Comment 10 S. Burmeister 2012-01-07 22:20:38 UTC
For an imap accopunt I see that filtering only works for downloaded items.

If one has a thread of six unread emails from a mailinglist and selects the first (it is shown in the preview-pane), presses shift and clicks on the last one (shown in the preview pane as well) all messages in the thread get selected.

However, issuing ctrl+j and watching the filter log shows that the same filter fails for all but the messages that were already shown in the preview pane, i.e. downloaded to akonadi's cache. So one ends-up with four unfiltered messages.

So my guess is that kmail2 forgets to download some content or header before checking whether the filter applies.
Comment 11 sorath 2012-04-25 21:51:11 UTC
I have the same problem with filtering of incoming messages (from apache incubator dev list).

After I go to "Settings" menu - "Configure FIlters" - "Advanced" tab - and uncheck "If this filter matches, stop processing here" - then it seems that the filter starts to  work for all corresponding messages (manual call of filter worked before this changes). 

But I need some days to check if it works permanently correct for me.
Comment 12 sorath 2012-04-26 15:57:23 UTC
Some messages is not filtering still
Comment 13 András Manţia 2013-02-28 08:23:56 UTC
Fixed in KDE 4.10.1 and later by Wolfgang Rohdewald.
http://commits.kde.org/kdepim/185c572e079ef40bee2225e582c11dbdbb35840f
Comment 14 Ivan S. J. 2013-07-05 12:49:34 UTC
I'm using KDE/kmail2 4.10.3 from opensuse 12.3 and I still see this problem. Filters are not automatically performed on inbound maildir.

When I send a message to myself I see this in the filter log viewer:
---snip---
------------------------------
[14:42:00] Begin filtering on message "filter test 10" from "Ivan Skytte Jørgensen " at "Friday 05 July 2013 14:42" :
------------------------------
[14:42:00] Begin filtering on message "filter test 10" from "Ivan Skytte Jørgensen " at "Friday 05 July 2013 14:42" :
---snip---

When I then press ctrl-L to check emails again, the email appears in the inbound maildir but filter log viewer shows nothing.

When I then go to the inbound maildir, mark the message and press ctrl-J to apply the filters I see this:
---snip---
------------------------------
[14:42:50] Begin filtering on message "filter test 10" from "Ivan Skytte Jørgensen " at "Friday 05 July 2013 14:42" :
[14:42:50] Evaluating filter rules: (match all of the following) "X-Original-To" <contains> "redacted1@redacted.example.com"
[14:42:50] 0 = "X-Original-To" <contains> "redacted1@redacted.example.com" (redacted1@redacted.example.com)
[14:42:50] Evaluating filter rules: (match all of the following) "X-Original-To" <contains> "redacted2@redacted.example.com"
[14:42:50] 0 = "X-Original-To" <contains> "redacted2@redacted.example.com" (redacted2@redacted.example.com)
[14:42:50] Evaluating filter rules: (match all of the following) "X-Original-To" <contains> "redacted3@redacted.example.com"
[14:42:50] 0 = "X-Original-To" <contains> "redacted3@redacted.example.com" (redacted3@redacted.example.com)
[14:42:50] Evaluating filter rules: (match all of the following) "X-Original-To" <contains> "redacted4@redacted.example.com"
[14:42:50] 0 = "X-Original-To" <contains> "redacted4@redacted.example.com" (redacted4@redacted.example.com)
[14:42:50] Evaluating filter rules: (match all of the following)
[14:42:50] Filter rules have matched.
[14:42:50] Applying filter action: Move Into Folder "KMail Folders/redacted"
---snip---

Should this case be reopened, or should a new case be created for this?
Comment 15 András Manţia 2013-07-09 21:09:09 UTC
For those still having the problem, can you check in the advanced tab that the filter is enable for ALL accounts? If not, and the filter in question does not work for POP3 you might see bug 308008.
Comment 16 Ivan S. J. 2013-07-09 22:49:14 UTC
All my filters are configured to be applied to all accounts.