Bug 392167 - Newlines in MIME parsing cause S/MIME signature to fail
Summary: Newlines in MIME parsing cause S/MIME signature to fail
Status: REPORTED
Alias: None
Product: kmail2
Classification: Applications
Component: crypto (show other bugs)
Version: 5.21.3
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-22 10:28 UTC by Michał Goliński
Modified: 2022-11-18 08:28 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
A failing email saved form KMail. (215.84 KB, application/mbox)
2018-03-22 10:32 UTC, Michał Goliński
Details
The same email when save from thunderbird (218.67 KB, message/rfc822)
2018-03-22 10:34 UTC, Michał Goliński
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Goliński 2018-03-22 10:28:08 UTC
KMail mangles newlines in a multipart message. This causes siganture verification to fail.

I believe this is caused by parts in multipart messages that do not end with a newline.

The attached file shows the problem. It is a message that has the following structure:

multipart/signed
    multipart/mixed
        multipart/related
            text/html
            image/jpeg
            image/jpeg
            image/jpeg
            image/jpeg
            image/jpeg
            image/jpeg
            image/jpeg
            image/jpeg
            image/jpeg
            image/jpeg
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
        application/pdf
    application/pkcs7-signature

KMail adds a newline after the end boundary of multipart/related and before the boundary of multipart/mixed (in the marked place).
Comment 1 Michał Goliński 2018-03-22 10:32:39 UTC
Created attachment 111553 [details]
A failing email saved form KMail.

Note the spurious newline at line 2157.
Comment 2 Michał Goliński 2018-03-22 10:34:08 UTC
Created attachment 111554 [details]
The same email when save from thunderbird

Note that there is no blank line at line 2154
Comment 3 Justin Zobel 2022-11-18 04:30:14 UTC
Thank you for reporting this issue in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Comment 4 Michał Goliński 2022-11-18 08:27:49 UTC
Yes, seems to still be the case, exactly as before, saving the same message from inside kmail and from outlook webmail gives extra newlines between mime parts.