Bug 291745 - filters not applied on read emails
Summary: filters not applied on read emails
Status: RESOLVED INTENTIONAL
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: Mail Filter Agent (show other bugs)
Version: 4.8
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-17 08:50 UTC by tim blechmann
Modified: 2012-12-16 16:01 UTC (History)
2 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 tim blechmann 2012-01-17 08:50:52 UTC
Version:           4.8 (using Devel) 
OS:                Linux

i'm running kmail on 2 machines, my laptop and my workstation. the filter rules are similar, but they do not match, especially the workstation has more filter rules than the laptop.

however if i read emails in INBOX on my laptop, but the filter rules on the workstation should move them to a different directory, the filter is not applied (possibly because it does not filter read emails?). i have to select the specific mails and apply the filter manually.

seems to be an issue on both 4.7 and 4.8

Reproducible: Always

Steps to Reproduce:
use the same imap account on at least two machines with different filter rules.

Actual Results:  
filters are not applied

Expected Results:  
filters should be applied
Comment 1 András Manţia 2012-02-11 22:54:33 UTC
I can confirm this with IMAP Inbox. If the mail is read with a different client (e.g webmail), on the next sync the filter is not applied to the read mails.
Comment 2 András Manţia 2012-10-13 22:38:10 UTC
Actually after looking at the code and thinking more, this is intentional. 
To explain it: filters are applied that appear in special folders (Inbox). If we would filter also newly added read mail, it would be impossible to move back a mail that was filtered to inbox (for whatever reasons, including bad filtering). 
For similar reasons mails marked as ignored or spam are also excluded from filters.
Comment 3 tim blechmann 2012-10-14 09:23:54 UTC
well, i've stopped using kmail for other reasons, but i fail to see the reason why this is not possible. if a mail was moved to inbox by a filter, the filter could simply ignore that mail. pseudocode:

newlyAddedMails = collectNewlyAddedMails();
foreach (mail in newlyAddedMails):
  applyFilter(mail)

if applyFilter moves the mail to inbox, it won't be filtered, again.
Comment 4 Michael Reiher 2012-12-16 16:01:27 UTC
Please reconsider setting this as Won't Fix. For instance I read regularly mail through a webmail frontend at work or through the mail client of my phone, none of these have filters setup but mark mails as read. Which is IMHO a perfectly usual use case. And at home I always have to filter them again manually. This is pretty annoying behavior. 

And actually I don't understand the problem. Simply filter all mails newly synced to Inbox, and ignore manually moved mails (set a flag or whatever). Maybe this is not trivial with the current implementation (no idea) and takes a bit longer to fix, but this doesn't mean the behavior is correct.