|
|
|
@ -166,9 +166,17 @@ KMime::Message::Ptr CryptoUtils::assembleMessage(const KMime::Message::Ptr &orig |
|
|
|
out->setBody(const_cast<KMime::Content *>(newContent)->encodedBody()); |
|
|
|
out->setBody(const_cast<KMime::Content *>(newContent)->encodedBody()); |
|
|
|
out->parse(); |
|
|
|
out->parse(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// remove default explicit content headers added by KMime::Content::parse()
|
|
|
|
|
|
|
|
QVector<KMime::Headers::Base *> headers = out->headers(); |
|
|
|
|
|
|
|
for (const auto hdr : std::as_const(headers)) { |
|
|
|
|
|
|
|
if (isContentHeader(hdr)) { |
|
|
|
|
|
|
|
out->removeHeader(hdr->type()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Copy over headers from the original message, except for CT, CTE and CD
|
|
|
|
// Copy over headers from the original message, except for CT, CTE and CD
|
|
|
|
// headers, we want to preserve those from the new content
|
|
|
|
// headers, we want to preserve those from the new content
|
|
|
|
QVector<KMime::Headers::Base *> headers = orig->headers(); |
|
|
|
headers = orig->headers(); |
|
|
|
for (const auto hdr : std::as_const(headers)) { |
|
|
|
for (const auto hdr : std::as_const(headers)) { |
|
|
|
if (isContentHeader(hdr)) { |
|
|
|
if (isContentHeader(hdr)) { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
|