Use base64 encoding for all non-text attachments
ClosedPublic

Authored by dvratil on May 7 2017, 12:23 PM.

Details

Summary

Use base64 encoding for all non-text attachments, only use KMime::encodingForData()
for text/* and message/* attachments.

KMime::encodingForData() uses character occurrence frequency to choose optimal encoding,
but in case of binary documents (like PDF) this can get completely off and choose the wrong
encoding and CRLF/LF conversion then corrupts the binary data, making the attachment unreadable.

See https://bugs.kde.org/show_bug.cgi?id=95733 for details

Diff Detail

Repository
R94 PIM: Message Library
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
dvratil created this revision.May 7 2017, 12:23 PM
Restricted Application added a subscriber: KDE PIM. · View Herald TranscriptMay 7 2017, 12:23 PM
mlaurent accepted this revision.May 8 2017, 6:40 AM

It seems ok for me

This revision is now accepted and ready to land.May 8 2017, 6:40 AM
This revision was automatically updated to reflect the committed changes.