when decryption fails, copy mail encrypted
Needs ReviewPublic

Authored by mkoller on Apr 5 2020, 3:29 PM.

Details

Reviewers
mlaurent
knauss
Summary

In KMCopyDecryptedCommand, when decrypting a mail fails, it will try to create a new Akonadi::Item with no payload, which fails.

This patch simply checks for the return value of MailCommon::CryptoUtils::decryptMessage() and if no mail is returned, it will use the original mail (same behavior as if an unknown encryption is found in CryptoUtils)

Test Plan

"copy decrypted mail to..." with a mail which can not be decrypted
(I have such mails but I still need to investigate why they can not be decrypted)

Diff Detail

Repository
R206 KMail
Lint
Lint Skipped
Unit
Unit Tests Skipped
mkoller created this revision.Apr 5 2020, 3:29 PM
Restricted Application added a project: KDE PIM. · View Herald TranscriptApr 5 2020, 3:29 PM
Restricted Application added a subscriber: kde-pim. · View Herald Transcript
mkoller requested review of this revision.Apr 5 2020, 3:29 PM
knauss added a comment.May 6 2020, 6:43 PM

Seems fine. But this should get a testcase. Unfortuantelly there is more to do to create one (src/autotests/kmcommandstest.cpp) Do you need/want help with that?