Bug 1920 - No automatic NNTP filtering
Summary: No automatic NNTP filtering
Status: RESOLVED FIXED
Alias: None
Product: Claws Mail
Classification: Unclassified
Component: Filtering (show other bugs)
Version: 3.10.0
Hardware: PC Windows XP
: P3 normal
Assignee: users
URL:
: 2627 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-05-21 23:51 CEST by rgaddi
Modified: 2018-12-30 00:36 CET (History)
2 users (show)

See Also:


Attachments
[PATCH 1/2] fix nntp filtering on incoming messages (1.45 KB, patch)
2015-07-26 05:54 CEST, Stephan Sachse
no flags Details | Diff
[PATCH 2/2] fix nntp manually filtering with account specific rules (2.93 KB, patch)
2015-07-26 05:55 CEST, Stephan Sachse
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description rgaddi 2009-05-21 23:51:13 CEST
My filters all work fine when I execute them manually, but newly received messages on my NNTP account are not being automatically filtered on their way in.  "Filter messages on receiving" and "Allow filtering using plugins on receiving" are both checked for the news account.
Comment 1 Brian Morrison 2009-05-22 09:14:26 CEST
I have the same behaviour, I have worked around it for now using processing rules but of course that does mean I need to select another folder and then re-enter a news folder for the processing to trigger.
Comment 2 Paul 2009-05-22 09:22:49 CEST
> that does mean I need to select another folder and then
> re-enter a news folder for the processing to trigger.

... or using the folder context menu item, 'Run processing rules'
Comment 3 Paul 2014-04-27 12:56:55 CEST
*** Bug 2627 has been marked as a duplicate of this bug. ***
Comment 4 boxcars 2014-04-28 21:29:05 CEST
bug 2627 (dupe) comment 6 has a workaround that's infinitely preferable to using processing instead.
Comment 5 Stephan Sachse 2015-07-26 05:54:26 CEST
Created attachment 1547 [details]
[PATCH 1/2] fix nntp filtering on incoming messages

this should fix bug #1920 and bug #2627

folder_item_scan_full() in folder.c at line 2343 applies filter only to
folder items of special type F_INBOX. but nntp folder items are of
special folder item type F_NORMAL and folder type F_NEWS. so i change
the condition for do_filter to also match nntp folders. works for me on
fedora 22 and claws-mail-3.11.1
Comment 6 Stephan Sachse 2015-07-26 05:55:19 CEST
Created attachment 1548 [details]
[PATCH 2/2] fix nntp manually filtering with account specific rules

manually running filter on nntp folders doesn't work correctly with
account specific rules. filtering_match_condition() in filtering.c:568
always gets a NULL as ac_prefs and every check with ac_prefs fails
subsequently. later cur_account is used instead, what is imo clearly
wrong and useless.

i have patched summaryview.c:5649 summary_filter() to extract the
account data from summaryview and hand over them as new parameter to
summary_filter_func().

works for me on fedora 22 and claws-mail-3.11.1
Comment 7 boxcars 2015-09-03 02:23:21 CEST
Both patches work for me, building using Gentoo's claws-mail-3.11.1-r1. Thanks, Stephan!
Comment 8 boxcars 2015-12-01 20:29:09 CET
These patches still apply to 3.13.0.  Does "RESOLVED PATCHESWELCOME" mean someone on the Claws team might review them someday?
Comment 9 Ricardo Mones 2015-12-27 15:58:46 CET
The bug was closed as PATCHESWELCOME and has received patches, reopening.
Comment 10 Stephan Sachse 2017-10-07 02:03:24 CEST
i've done a rebase

no changes since last pull request

available in the git repository at:

  https://github.com/stesachse/claws.git bz1920_no_automatic_nntp_filtering

compare the changes at:

  https://github.com/stesachse/claws/compare/bz1920_no_automatic_nntp_filtering

/me
Comment 11 Andrej Kacian 2018-12-30 00:36:02 CET
Both patches tested and pushed to git, (belated) thanks! :)