[Kde-pim] Re: IMAP filtering doesn't work?

Stephen Kelly steveire at gmail.com
Sat May 21 08:58:47 BST 2011


Tobias König wrote:

> On Saturday 21 May 2011 08:17:45 Stephen Kelly wrote:
>> Hi,
> Hej,
> 
>> I was pointed to this on my blog:
>> 
>> https://bugs.kde.org/show_bug.cgi?id=255388
>> (Kmail filters dont work in incoming mail)
> After a short glance at the code it seems that the FilterManager will only
> act on new emails that are in a collection with remote id 'inbox' (see
> Kernel::folderIsInbox() in kdepim/mailcommon/mailkernel.cpp).
> 
> So we should ask the bug reporters if this applies to their setup. We have
> one bug report about broken filtering with POP3, where the target folder
> of the POP3 resource is != inbox.
> 
> The correct fix for this would be a list of collections that the filter
> code shall look in. And the POP3 resource and KMail allows the user to add
> additional collections to this list.

Is it normal to only filter inbox?

How did KMail1 handle this? Filter on all folders all the time? Make the 
user use a dialog?

Any reason a patch like 

diff --git a/mailcommon/filtermanager.cpp b/mailcommon/filtermanager.cpp
index e874ec9..e578ec0 100644
--- a/mailcommon/filtermanager.cpp
+++ b/mailcommon/filtermanager.cpp
@@ -102,12 +102,10 @@ void FilterManager::Private::tryToMonitorCollection()
 void FilterManager::Private::slotInitialCollectionsFetched( const 
Akonadi::Collection::List &collections )
 {
   foreach ( const Akonadi::Collection &collection, collections ) {
-    if ( CommonKernel->folderIsInbox( collection ) ) {
-      Akonadi::ItemFetchJob *job = new Akonadi::ItemFetchJob( collection, q 
);
-      job->fetchScope().fetchAllAttributes();
-      q->connect( job, SIGNAL( itemsReceived( const Akonadi::Item::List& ) 
),
-                  q, SLOT( slotInitialItemsFetched( const 
Akonadi::Item::List& ) ) );
-    }
+    Akonadi::ItemFetchJob *job = new Akonadi::ItemFetchJob( collection, q 
);
+    job->fetchScope().fetchAllAttributes();
+    q->connect( job, SIGNAL( itemsReceived( const Akonadi::Item::List& ) ),
+                q, SLOT( slotInitialItemsFetched( const 
Akonadi::Item::List& ) ) );
   }
 }

Would not work?

I see there's a MailFilter class too. Does that know the target from the 
filter file that it's supposed to work on? If it does we can get the 
relevant collections from that.



_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list