https://bugs.kde.org/show_bug.cgi?id=520875
Bug ID: 520875
Summary: Email messages with wrong content type get CRLF to LF
convertion in NodeHelper::writeNodeToTempFile
Classification: Frameworks and Libraries
Product: mimetreeparser
Version First unspecified
Reported In:
Platform: Other
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: General
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
DESCRIPTION
I have been receiving invoices from a specific vendor via email and the invoice
pdfs when viewed directly via kmail appear corrupted. If I save the attachment
as a file and then open the pdf file with okular, the file appears correctly.
The issue is that the automated system the vendor uses to send the invoices,
incorrectly sets the content type as "pdf" instead of the correct
"application/pdf". This results in getting a content type of "text/plain" in
https://invent.kde.org/frameworks/kmime/-/blob/master/src/content.cpp?ref_type=heads#L141
and then in
https://invent.kde.org/pim/messagelib/-/blob/master/mimetreeparser/src/nodehelper.cpp?ref_type=heads#L211
the code considers the attachment as text and applies CRLF to LF conversion.
This conversion unfortunately corrupts part of the temporary file. This
temporary file is used by kmail when you ask to open the attachment directly.
Is checking mime type by file content using KMimeType::findByContent()
considered insecure? Testing the mimetype before applying the CRLF conversion
could help with file corruption but the attachment will still appear as a
text/plain attachment and kmail will try to open the attachment with kate.
SOFTWARE/OS VERSIONS
Operating System (available in the Info Center app, or by running `kinfo` in a
terminal window):
KDE Plasma Version: 6.6.4
KDE Frameworks Version: 6.24.0
Qt Version: 6.10.2
ADDITIONAL INFORMATION
The issue is still present in master.
--
You are receiving this mail because:
You are watching all bug changes.