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 );