When an imap message is filtered through spamc and classified as spam, a

new message is constructed and returned which has a new set of headers.
Consequently there is no X-UID header anymore. If the message is then left
in the same folder and not moved somewhere else, the original mail is
removed from the folder on the server and the new one uploaded. To figure
out which mail to remove, the (now missing) X-UID header is looked at.
That is not there -> no uid -> message is not delete (used to be folder is
expunged). To avoid that, restore the X-UID header after the pipe through
to make sure it's there. Not really correct, technically, but I can't
think of another reliable way to fix this.

Thanks a lot to Arnaud Burlet for helping me track this bugger down and
testing.

Backport?

CCMAIL: 74017-done@bugs.kde.org

svn path=/trunk/kdepim/; revision=285431
wilder-work
Till Adam 22 years ago
parent c6115b93b2
commit e923fae0b2
  1. 10
      kmfilteraction.cpp

@ -504,8 +504,16 @@ KMFilterAction::ReturnCode KMFilterActionWithCommand::genericProcess(KMMessage*
// read altered message:
QByteArray msgText = kmkernel->getCollectedStdOut( &shProc );
if ( !msgText.isEmpty() )
if ( !msgText.isEmpty() ) {
/* If the pipe through alters the message, it could very well
happen that it no longer has a X-UID header afterwards. That is
unfortunate, as we need to removed the original from the folder
using that, and look it up in the message. When the (new) message
is uploaded, the header is stripped anyhow. */
QString uid = aMsg->headerField("X-UID");
aMsg->fromByteArray( msgText );
aMsg->setHeaderField("X-UID",uid);
}
else
return ErrorButGoOn;
}

Loading…
Cancel
Save