[Kde-pim] mailfilter does not see all incoming messages

Wolfgang Rohdewald wolfgang at rohdewald.de
Wed Feb 13 09:34:46 GMT 2013


using KDE master

my filter for incoming mail does not get noticed of all new mails.
if I get 10 mails (sent by myself from somewhere else), between 0 and 3
remain in inbox. The ignored mails are always some of the last ones,
the first 5 mails always get through to mailfilter.

I added some debug output to MailFilterAgent::itemAdded and now I can
see that this agent indeed does not receive all items. Whereas the
nepomuk feeder does. In the log below, mailfilter does not get item 177.

Where should I search for the problem? I already tried to make the 
Akonadi::Monitor in mailfilter more similar to the one in nepomukfeeder, but
that did not change anything. mailfilter ignores items with wrong mime-type,
but I verified this is not the problem.

The message "1 item create jobs are pending" seems interesting but the
number of pending messages most often does not correspond to the
number of  missed items.

akonadi_pop3_resource_0(2713)/akonadiresource (pop3) POP3Resource::doStateStep: We are going to download 10 messages
akonadi_mailfilter_agent(2711) MailFilterAgent::itemAdded: 169
akonadi_nepomuk_feeder(2712) Akonadi::NepomukFeederAgent::itemAdded: 169
akonadi_nepomuk_feeder(2712) Akonadi::NepomukFeederAgent::itemAdded: 170
akonadi_nepomuk_feeder(2712) Akonadi::NepomukFeederAgent::itemAdded: 171
akonadi_nepomuk_feeder(2712) Akonadi::NepomukFeederAgent::itemAdded: 172
akonadi_mailfilter_agent(2711) MailFilterAgent::itemAdded: 170
akonadi_mailfilter_agent(2711) MailFilterAgent::itemAdded: 171
akonadi_mailfilter_agent(2711) MailFilterAgent::itemAdded: 172
akonadi_mailfilter_agent(2711) MailFilterAgent::itemAdded: 173
akonadi_mailfilter_agent(2711) MailFilterAgent::itemAdded: 174
akonadi_mailfilter_agent(2711) MailFilterAgent::itemAdded: 175
akonadi_mailfilter_agent(2711) MailFilterAgent::itemAdded: 176
akonadi_nepomuk_feeder(2712) Akonadi::NepomukFeederAgent::itemAdded: 173
akonadi_nepomuk_feeder(2712) Akonadi::NepomukFeederAgent::itemAdded: 174
akonadi_nepomuk_feeder(2712) Akonadi::NepomukFeederAgent::itemAdded: 175
akonadi_nepomuk_feeder(2712) Akonadi::NepomukFeederAgent::itemAdded: 176
akonadi_pop3_resource_0(2713)/akonadiresource (pop3) POP3Resource::fetchJobResult: Downloaded 10 mails
akonadi_pop3_resource_0(2713)/akonadiresource (pop3) POP3Resource::doStateStep: ================ Starting state Save ===========================
akonadi_pop3_resource_0(2713)/akonadiresource (pop3) POP3Resource::doStateStep: 1 item create jobs are pending
akonadi_pop3_resource_0(2713)/akonadiresource (pop3) POP3Resource::doStateStep: ================ Starting state Delete =========================
akonadi_pop3_resource_0(2713)/akonadiresource (pop3) POP3Resource::idsToDelete: Going to delete 10 (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
akonadi_mailfilter_agent(2711) MailFilterAgent::itemAdded: 178
akonadi_nepomuk_feeder(2712) Akonadi::NepomukFeederAgent::itemAdded: 177
akonadi_nepomuk_feeder(2712) Akonadi::NepomukFeederAgent::itemAdded: 178
akonadi_pop3_resource_0(2713)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
akonadi_pop3_resource_0(2713)/akonadiresource (pop3) POP3Resource::doStateStep: ================ Starting state Quit ===========================
akonadi_pop3_resource_0(2713)/akonadiresource (pop3) POP3Resource::doStateStep: ================ Starting state SavePassword ===================
akonadi_pop3_resource_0(2713)/akonadiresource (pop3) POP3Resource::finish: ================= Mail check finished. =============================

and these are the changes I tried on mailfilter, generating the above output:

diff --git a/mailfilteragent/mailfilteragent.cpp b/mailfilteragent/mailfilteragent.cpp
index 00df47c..214671a 100644
--- a/mailfilteragent/mailfilteragent.cpp
+++ b/mailfilteragent/mailfilteragent.cpp
@@ -66,9 +66,10 @@ MailFilterAgent::MailFilterAgent( const QString &id )
 
   Akonadi::Monitor *collectionMonitor = new Akonadi::Monitor( this );
   collectionMonitor->fetchCollection( true );
-  collectionMonitor->ignoreSession( Akonadi::Session::defaultSession() );
+  collectionMonitor->setAllMonitored( true );
+//  collectionMonitor->ignoreSession( Akonadi::Session::defaultSession() );
   collectionMonitor->collectionFetchScope().setAncestorRetrieval( Akonadi::CollectionFetchScope::All );
-  collectionMonitor->setMimeTypeMonitored( KMime::Message::mimeType() );
+//  collectionMonitor->setMimeTypeMonitored( KMime::Message::mimeType() );
 
   connect( collectionMonitor, SIGNAL(collectionAdded(Akonadi::Collection,Akonadi::Collection)),
            this, SLOT(mailCollectionAdded(Akonadi::Collection,Akonadi::Collection)) );
@@ -148,8 +149,11 @@ void MailFilterAgent::itemAdded( const Akonadi::Item &item, const Akonadi::Colle
   /* The monitor mimetype filter would override the collection filter, therefor we have to check
    * for the mimetype of the item here.
    */
-  if ( item.mimeType() != KMime::Message::mimeType() )
+  if ( item.mimeType() != KMime::Message::mimeType() ) {
+kDebug() << "wrong mimetype in " << item.id();
     return;
+}
+kDebug() << item.id();
 
   MailCommon::SearchRule::RequiredPart requiredPart = m_filterManager->requiredPart(collection.resource());
 


-- 
Wolfgang
_______________________________________________
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