From kde-commits Fri Apr 29 04:07:13 2005 From: Don Sanders Date: Fri, 29 Apr 2005 04:07:13 +0000 To: kde-commits Subject: kdepim/kmail Message-Id: <20050429040713.E68D7629 () office ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=111474764909724 CVS commit by sanders: Sanity checking for applying filters on the saved list of unfiltered messages. This could be better, I really want to check that folder is equal to the inbox folder for this imap account. M +18 -1 kmacctimap.cpp 1.195 --- kdepim/kmail/kmacctimap.cpp #1.194:1.195 @@ -410,7 +411,23 @@ void KMAcctImap::postProcessNewMail( KMF kmkernel->msgDict()->getLocation( *filterIt, &folder, &idx ); // It's possible that the message has been deleted or moved into a - // different folder + // different folder, or that the serNum is stale + + KMFolderImap *imapFolder = static_cast(folder->storage()); + if (!imapFolder->folder()->isSystemFolder() || + !(imapFolder->imapPath() == "/INBOX/") ) { // sanity checking + mFilterSerNumsToSave.remove( QString( "%1" ).arg( *filterIt ) ); + ++filterIt; + continue; + } + if (folder && (idx != -1)) { + msg = folder->getMsg( idx ); + if (!msg) { // sanity checking + mFilterSerNumsToSave.remove( QString( "%1" ).arg( *filterIt ) ); + ++filterIt; + continue; + } + if (msg->transferInProgress()) { inTransit.append( *filterIt );