diff --git a/kmsender.cpp b/kmsender.cpp index e50b3cde9..376b99c97 100644 --- a/kmsender.cpp +++ b/kmsender.cpp @@ -35,6 +35,7 @@ using namespace KMime::Types; #include "kmmsgdict.h" #include "kmmsgpart.h" #include "protocols.h" +#include "kmcommands.h" #include #define SENDER_GROUP "sending mail" @@ -349,7 +350,11 @@ void KMSender::doSendMsg() cleanup(); return; } - if (imapSentFolder) imapSentFolder->moveMsg(mCurrentMsg); + if (imapSentFolder) { + // Does proper folder refcounting and message locking + KMCommand *command = new KMMoveCommand( imapSentFolder, mCurrentMsg ); + command->start(); + } default: break; }