Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
PIM Messagelib
Commits
f140496f
Commit
f140496f
authored
Jul 01, 2020
by
Laurent Montel
Browse files
Don't create header when it's not necessary
parent
f0645324
Pipeline
#25535
passed with stage
in 47 minutes and 26 seconds
Changes
11
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
messagecomposer/src/helper/messagehelper.cpp
View file @
f140496f
...
...
@@ -164,9 +164,9 @@ void setAutomaticFields(const KMime::Message::Ptr &msg, bool aIsMulti)
if
(
aIsMulti
||
msg
->
contents
().
size
()
>
1
)
{
// Set the type to 'Multipart' and the subtype to 'Mixed'
msg
->
contentType
()
->
setMimeType
(
"multipart/mixed"
);
msg
->
contentType
(
false
)
->
setMimeType
(
"multipart/mixed"
);
// Create a random printable string and set it as the boundary parameter
msg
->
contentType
()
->
setBoundary
(
KMime
::
multiPartBoundary
());
msg
->
contentType
(
false
)
->
setBoundary
(
KMime
::
multiPartBoundary
());
}
}
}
messagecomposer/src/job/protectedheaders.cpp
View file @
f140496f
...
...
@@ -89,9 +89,10 @@ void ProtectedHeadersJob::doStart()
if
(
d
->
obvoscate
&&
subject
)
{
// Create protected header lagacy mimepart with replaced headers
SinglepartJob
*
cjob
=
new
SinglepartJob
;
cjob
->
contentType
()
->
setMimeType
(
"text/plain"
);
cjob
->
contentType
()
->
setCharset
(
subject
->
rfc2047Charset
());
cjob
->
contentType
()
->
setParameter
(
QStringLiteral
(
"protected-headers"
),
QStringLiteral
(
"v1"
));
auto
ct
=
cjob
->
contentType
();
ct
->
setMimeType
(
"text/plain"
);
ct
->
setCharset
(
subject
->
rfc2047Charset
());
ct
->
setParameter
(
QStringLiteral
(
"protected-headers"
),
QStringLiteral
(
"v1"
));
cjob
->
contentDisposition
()
->
setDisposition
(
KMime
::
Headers
::
contentDisposition
::
CDinline
);
cjob
->
setData
(
subject
->
type
()
+
QByteArray
(
": "
)
+
subject
->
asUnicodeString
().
toUtf8
());
...
...
messagecomposer/src/utils/util.cpp
View file @
f140496f
...
...
@@ -138,60 +138,69 @@ void MessageComposer::Util::makeToplevelContentType(KMime::Content *content, Kle
switch
(
format
)
{
default:
case
Kleo
::
InlineOpenPGPFormat
:
case
Kleo
::
OpenPGPMIMEFormat
:
case
Kleo
::
OpenPGPMIMEFormat
:
{
auto
ct
=
content
->
contentType
();
//Create
if
(
sign
)
{
c
ontent
->
contentType
()
->
setMimeType
(
QByteArrayLiteral
(
"multipart/signed"
));
c
ontent
->
contentType
()
->
setParameter
(
QStringLiteral
(
"protocol"
),
QStringLiteral
(
"application/pgp-signature"
));
c
ontent
->
contentType
()
->
setParameter
(
QStringLiteral
(
"micalg"
),
QString
::
fromLatin1
(
QByteArray
(
QByteArrayLiteral
(
"pgp-"
)
+
hashAlgo
)).
toLower
());
c
t
->
setMimeType
(
QByteArrayLiteral
(
"multipart/signed"
));
c
t
->
setParameter
(
QStringLiteral
(
"protocol"
),
QStringLiteral
(
"application/pgp-signature"
));
c
t
->
setParameter
(
QStringLiteral
(
"micalg"
),
QString
::
fromLatin1
(
QByteArray
(
QByteArrayLiteral
(
"pgp-"
)
+
hashAlgo
)).
toLower
());
}
else
{
c
ontent
->
contentType
()
->
setMimeType
(
QByteArrayLiteral
(
"multipart/encrypted"
));
c
ontent
->
contentType
()
->
setParameter
(
QStringLiteral
(
"protocol"
),
QStringLiteral
(
"application/pgp-encrypted"
));
c
t
->
setMimeType
(
QByteArrayLiteral
(
"multipart/encrypted"
));
c
t
->
setParameter
(
QStringLiteral
(
"protocol"
),
QStringLiteral
(
"application/pgp-encrypted"
));
}
}
return
;
case
Kleo
::
SMIMEFormat
:
case
Kleo
::
SMIMEFormat
:
{
if
(
sign
)
{
auto
ct
=
content
->
contentType
();
//Create
qCDebug
(
MESSAGECOMPOSER_LOG
)
<<
"setting headers for SMIME"
;
c
ontent
->
contentType
()
->
setMimeType
(
QByteArrayLiteral
(
"multipart/signed"
));
c
ontent
->
contentType
()
->
setParameter
(
QStringLiteral
(
"protocol"
),
QStringLiteral
(
"application/pkcs7-signature"
));
c
ontent
->
contentType
()
->
setParameter
(
QStringLiteral
(
"micalg"
),
QString
::
fromLatin1
(
hashAlgo
).
toLower
());
c
t
->
setMimeType
(
QByteArrayLiteral
(
"multipart/signed"
));
c
t
->
setParameter
(
QStringLiteral
(
"protocol"
),
QStringLiteral
(
"application/pkcs7-signature"
));
c
t
->
setParameter
(
QStringLiteral
(
"micalg"
),
QString
::
fromLatin1
(
hashAlgo
).
toLower
());
return
;
}
// fall through (for encryption, there's no difference between
// SMIME and SMIMEOpaque, since there is no mp/encrypted for
// S/MIME)
}
Q_FALLTHROUGH
();
case
Kleo
::
SMIMEOpaqueFormat
:
qCDebug
(
MESSAGECOMPOSER_LOG
)
<<
"setting headers for SMIME/opaque"
;
content
->
contentType
()
->
setMimeType
(
QByteArrayLiteral
(
"application/pkcs7-mime"
));
auto
ct
=
content
->
contentType
();
//Create
ct
->
setMimeType
(
QByteArrayLiteral
(
"application/pkcs7-mime"
));
if
(
sign
)
{
c
ontent
->
contentType
()
->
setParameter
(
QStringLiteral
(
"smime-type"
),
QStringLiteral
(
"signed-data"
));
c
t
->
setParameter
(
QStringLiteral
(
"smime-type"
),
QStringLiteral
(
"signed-data"
));
}
else
{
c
ontent
->
contentType
()
->
setParameter
(
QStringLiteral
(
"smime-type"
),
QStringLiteral
(
"enveloped-data"
));
c
t
->
setParameter
(
QStringLiteral
(
"smime-type"
),
QStringLiteral
(
"enveloped-data"
));
}
c
ontent
->
contentType
()
->
setParameter
(
QStringLiteral
(
"name"
),
QStringLiteral
(
"smime.p7m"
));
c
t
->
setParameter
(
QStringLiteral
(
"name"
),
QStringLiteral
(
"smime.p7m"
));
}
}
void
MessageComposer
::
Util
::
setNestedContentType
(
KMime
::
Content
*
content
,
Kleo
::
CryptoMessageFormat
format
,
bool
sign
)
{
switch
(
format
)
{
case
Kleo
::
OpenPGPMIMEFormat
:
case
Kleo
::
OpenPGPMIMEFormat
:
{
auto
ct
=
content
->
contentType
();
//Create
if
(
sign
)
{
c
ontent
->
contentType
()
->
setMimeType
(
QByteArrayLiteral
(
"application/pgp-signature"
));
c
ontent
->
contentType
()
->
setParameter
(
QStringLiteral
(
"name"
),
QStringLiteral
(
"signature.asc"
));
c
t
->
setMimeType
(
QByteArrayLiteral
(
"application/pgp-signature"
));
c
t
->
setParameter
(
QStringLiteral
(
"name"
),
QStringLiteral
(
"signature.asc"
));
content
->
contentDescription
()
->
from7BitString
(
"This is a digitally signed message part."
);
}
else
{
c
ontent
->
contentType
()
->
setMimeType
(
QByteArrayLiteral
(
"application/octet-stream"
));
c
t
->
setMimeType
(
QByteArrayLiteral
(
"application/octet-stream"
));
}
}
return
;
case
Kleo
::
SMIMEFormat
:
case
Kleo
::
SMIMEFormat
:
{
if
(
sign
)
{
content
->
contentType
()
->
setMimeType
(
QByteArrayLiteral
(
"application/pkcs7-signature"
));
content
->
contentType
()
->
setParameter
(
QStringLiteral
(
"name"
),
QStringLiteral
(
"smime.p7s"
));
auto
ct
=
content
->
contentType
();
//Create
ct
->
setMimeType
(
QByteArrayLiteral
(
"application/pkcs7-signature"
));
ct
->
setParameter
(
QStringLiteral
(
"name"
),
QStringLiteral
(
"smime.p7s"
));
return
;
}
}
Q_FALLTHROUGH
();
// fall through:
default:
...
...
@@ -203,12 +212,13 @@ void MessageComposer::Util::setNestedContentType(KMime::Content *content, Kleo::
void
MessageComposer
::
Util
::
setNestedContentDisposition
(
KMime
::
Content
*
content
,
Kleo
::
CryptoMessageFormat
format
,
bool
sign
)
{
auto
ct
=
content
->
contentDisposition
();
if
(
!
sign
&&
format
&
Kleo
::
OpenPGPMIMEFormat
)
{
c
ontent
->
contentDisposition
()
->
setDisposition
(
KMime
::
Headers
::
CDinline
);
c
ontent
->
contentDisposition
()
->
setFilename
(
QStringLiteral
(
"msg.asc"
));
c
t
->
setDisposition
(
KMime
::
Headers
::
CDinline
);
c
t
->
setFilename
(
QStringLiteral
(
"msg.asc"
));
}
else
if
(
sign
&&
format
&
Kleo
::
SMIMEFormat
)
{
c
ontent
->
contentDisposition
()
->
setDisposition
(
KMime
::
Headers
::
CDattachment
);
c
ontent
->
contentDisposition
()
->
setFilename
(
QStringLiteral
(
"smime.p7s"
));
c
t
->
setDisposition
(
KMime
::
Headers
::
CDattachment
);
c
t
->
setFilename
(
QStringLiteral
(
"smime.p7s"
));
}
}
...
...
messagecore/src/attachment/attachmentfrommimecontentjob.cpp
View file @
f140496f
...
...
@@ -66,22 +66,22 @@ void AttachmentFromMimeContentJob::doStart()
part
->
setData
(
content
->
decodedContent
());
// Get the details from the MIME headers.
if
(
content
->
contentType
(
false
))
{
part
->
setMimeType
(
c
ontent
->
contentType
()
->
mimeType
());
part
->
setName
(
c
ontent
->
contentType
()
->
name
());
if
(
auto
ct
=
content
->
contentType
(
false
))
{
part
->
setMimeType
(
c
t
->
mimeType
());
part
->
setName
(
c
t
->
name
());
}
if
(
content
->
contentTransferEncoding
(
false
))
{
part
->
setEncoding
(
c
ontent
->
contentTransferEncoding
()
->
encoding
());
if
(
auto
ct
=
content
->
contentTransferEncoding
(
false
))
{
part
->
setEncoding
(
c
t
->
encoding
());
}
if
(
content
->
contentDisposition
(
false
))
{
part
->
setFileName
(
c
ontent
->
contentDisposition
()
->
filename
());
part
->
setInline
(
c
ontent
->
contentDisposition
()
->
disposition
()
==
KMime
::
Headers
::
CDinline
);
if
(
auto
ct
=
content
->
contentDisposition
(
false
))
{
part
->
setFileName
(
c
t
->
filename
());
part
->
setInline
(
c
t
->
disposition
()
==
KMime
::
Headers
::
CDinline
);
}
if
(
content
->
contentDescription
(
false
))
{
part
->
setDescription
(
c
ontent
->
contentDescription
()
->
asUnicodeString
());
if
(
auto
ct
=
content
->
contentDescription
(
false
))
{
part
->
setDescription
(
c
t
->
asUnicodeString
());
}
setAttachmentPart
(
part
);
...
...
messagecore/src/misc/imagecollector.cpp
View file @
f140496f
...
...
@@ -44,11 +44,12 @@ static bool isInExclusionList(KMime::Content *node)
return
true
;
}
if
(
node
->
contentType
()
->
mediaType
()
!=
"image"
)
{
auto
ct
=
node
->
contentType
();
//Create if necessary
if
(
ct
->
mediaType
()
!=
"image"
)
{
return
true
;
}
if
(
node
->
contentType
()
->
isMultipart
())
{
if
(
ct
->
isMultipart
())
{
return
true
;
}
...
...
messageviewer/src/messagepartthemes/default/defaultrenderer.cpp
View file @
f140496f
...
...
@@ -917,9 +917,9 @@ MimeTreeParser::IconType DefaultRendererPrivate::displayHint(const MimeTreeParse
bool
isHtmlPreferred
=
(
preferredMode
==
MimeTreeParser
::
Util
::
Html
)
||
(
preferredMode
==
MimeTreeParser
::
Util
::
MultipartHtml
);
QByteArray
mediaType
(
"text"
);
if
(
content
->
contentType
(
false
)
&&
!
content
->
contentType
()
->
mediaType
().
isEmpty
()
&&
!
content
->
contentType
()
->
subType
().
isEmpty
())
{
mediaType
=
content
->
contentType
()
->
mediaType
();
if
(
content
->
contentType
(
false
)
&&
!
content
->
contentType
(
false
)
->
mediaType
().
isEmpty
()
&&
!
content
->
contentType
(
false
)
->
subType
().
isEmpty
())
{
mediaType
=
content
->
contentType
(
false
)
->
mediaType
();
}
const
bool
isTextPart
=
(
mediaType
==
QByteArrayLiteral
(
"text"
));
...
...
messageviewer/src/viewer/mimeparttree/mimetreemodel.cpp
View file @
f140496f
...
...
@@ -76,8 +76,8 @@ public:
QString
mimeTypeForContent
(
KMime
::
Content
*
content
)
{
if
(
content
->
contentType
(
false
))
{
return
QString
::
fromLatin1
(
c
ontent
->
contentType
()
->
mimeType
());
if
(
auto
ct
=
content
->
contentType
(
false
))
{
return
QString
::
fromLatin1
(
c
t
->
mimeType
());
}
return
QString
();
}
...
...
@@ -106,13 +106,12 @@ public:
QIcon
iconForContent
(
KMime
::
Content
*
content
)
{
if
(
content
->
contentType
(
false
))
{
if
(
auto
ct
=
content
->
contentType
(
false
))
{
auto
iconName
=
MimeTreeParser
::
Util
::
iconNameForMimetype
(
QLatin1String
(
content
->
contentType
()
->
mimeType
()));
=
MimeTreeParser
::
Util
::
iconNameForMimetype
(
QLatin1String
(
ct
->
mimeType
()));
auto
mimeType
=
m_mimeDb
.
mimeTypeForName
(
QString
::
fromLatin1
(
c
ontent
->
contentType
()
->
mimeType
()));
=
m_mimeDb
.
mimeTypeForName
(
QString
::
fromLatin1
(
c
t
->
mimeType
()));
if
(
!
mimeType
.
isValid
()
||
mimeType
.
name
()
==
QLatin1String
(
"application/octet-stream"
))
{
const
QString
name
=
descriptionForContent
(
content
);
...
...
messageviewer/src/viewer/viewer_p.cpp
View file @
f140496f
...
...
@@ -283,11 +283,11 @@ void ViewerPrivate::openAttachment(KMime::Content *node, const QUrl &url)
return
;
}
if
(
node
->
contentType
(
false
))
{
if
(
node
->
contentType
()
->
mimeType
()
==
"text/x-moz-deleted"
)
{
if
(
auto
ct
=
node
->
contentType
(
false
))
{
if
(
ct
->
mimeType
()
==
"text/x-moz-deleted"
)
{
return
;
}
if
(
node
->
contentType
()
->
mimeType
()
==
"message/external-body"
)
{
if
(
ct
->
mimeType
()
==
"message/external-body"
)
{
if
(
node
->
contentType
()
->
hasParameter
(
QStringLiteral
(
"url"
)))
{
KIO
::
OpenUrlJob
*
job
=
new
KIO
::
OpenUrlJob
(
url
,
QStringLiteral
(
"text/html"
));
job
->
setUiDelegate
(
new
KIO
::
JobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
q
));
...
...
@@ -401,9 +401,9 @@ bool ViewerPrivate::deleteAttachment(KMime::Content *node, bool showWarning)
filename
=
node
->
contentDisposition
()
->
filename
();
}
if
(
node
->
contentType
(
false
))
{
name
=
node
->
contentType
()
->
name
();
mimetype
=
node
->
contentType
()
->
mimeType
();
if
(
auto
ct
=
node
->
contentType
(
false
))
{
name
=
ct
->
name
();
mimetype
=
ct
->
mimeType
();
}
// text/plain part:
...
...
@@ -1777,8 +1777,8 @@ void ViewerPrivate::showContextMenu(KMime::Content *content, const QPoint &pos)
return
;
}
if
(
content
->
contentType
(
false
))
{
if
(
c
ontent
->
contentType
()
->
mimeType
()
==
"text/x-moz-deleted"
)
{
if
(
auto
ct
=
content
->
contentType
(
false
))
{
if
(
c
t
->
mimeType
()
==
"text/x-moz-deleted"
)
{
return
;
}
}
...
...
mimetreeparser/src/bodyformatter/applicationpkcs7mime.cpp
View file @
f140496f
...
...
@@ -68,7 +68,7 @@ MessagePart::Ptr ApplicationPkcs7MimeBodyPartFormatter::process(Interface::BodyP
return
{};
}
const
QString
smimeType
=
node
->
contentType
()
->
parameter
(
QStringLiteral
(
"smime-type"
)).
toLower
();
const
QString
smimeType
=
node
->
contentType
(
false
)
->
parameter
(
QStringLiteral
(
"smime-type"
)).
toLower
();
if
(
smimeType
==
QLatin1String
(
"certs-only"
))
{
part
.
processResult
()
->
setNeverDisplayInline
(
true
);
...
...
mimetreeparser/src/nodehelper.cpp
View file @
f140496f
...
...
@@ -353,7 +353,7 @@ bool NodeHelper::isInEncapsulatedMessage(KMime::Content *node)
const
KMime
::
Content
*
cur
=
node
;
while
(
cur
&&
cur
!=
topLevel
)
{
const
bool
parentIsMessage
=
cur
->
parent
()
&&
cur
->
parent
()
->
contentType
(
false
)
&&
cur
->
parent
()
->
contentType
()
->
mimeType
().
toLower
()
==
"message/rfc822"
;
&&
cur
->
parent
()
->
contentType
(
false
)
->
mimeType
().
toLower
()
==
"message/rfc822"
;
if
(
parentIsMessage
&&
cur
->
parent
()
!=
topLevel
)
{
return
true
;
}
...
...
@@ -957,9 +957,9 @@ bool NodeHelper::unencryptedMessage_helper(KMime::Content *node, QByteArray &res
if
(
node
)
{
KMime
::
Content
*
curNode
=
node
;
KMime
::
Content
*
decryptedNode
=
nullptr
;
const
QByteArray
type
=
node
->
contentType
(
false
)
?
QByteArray
(
node
->
contentType
()
->
mediaType
()).
toLower
()
:
"text"
;
const
QByteArray
subType
=
node
->
contentType
(
false
)
?
node
->
contentType
()
->
subType
().
toLower
()
:
"plain"
;
const
bool
isMultipart
=
node
->
contentType
(
false
)
&&
node
->
contentType
()
->
isMultipart
();
const
QByteArray
type
=
node
->
contentType
(
false
)
?
QByteArray
(
node
->
contentType
(
false
)
->
mediaType
()).
toLower
()
:
"text"
;
const
QByteArray
subType
=
node
->
contentType
(
false
)
?
node
->
contentType
(
false
)
->
subType
().
toLower
()
:
"plain"
;
const
bool
isMultipart
=
node
->
contentType
(
false
)
&&
node
->
contentType
(
false
)
->
isMultipart
();
bool
isSignature
=
false
;
qCDebug
(
MIMETREEPARSER_LOG
)
<<
"("
<<
recursionLevel
<<
") Looking at"
<<
type
<<
"/"
<<
subType
;
...
...
@@ -993,22 +993,22 @@ bool NodeHelper::unencryptedMessage_helper(KMime::Content *node, QByteArray &res
headers
.
setHead
(
curNode
->
head
());
headers
.
parse
();
if
(
decryptedNode
->
contentType
(
false
))
{
headers
.
contentType
()
->
from7BitString
(
decryptedNode
->
contentType
()
->
as7BitString
(
false
));
headers
.
contentType
()
->
from7BitString
(
decryptedNode
->
contentType
(
false
)
->
as7BitString
(
false
));
}
else
{
headers
.
removeHeader
<
KMime
::
Headers
::
ContentType
>
();
}
if
(
decryptedNode
->
contentTransferEncoding
(
false
))
{
headers
.
contentTransferEncoding
()
->
from7BitString
(
decryptedNode
->
contentTransferEncoding
()
->
as7BitString
(
false
));
headers
.
contentTransferEncoding
()
->
from7BitString
(
decryptedNode
->
contentTransferEncoding
(
false
)
->
as7BitString
(
false
));
}
else
{
headers
.
removeHeader
<
KMime
::
Headers
::
ContentTransferEncoding
>
();
}
if
(
decryptedNode
->
contentDisposition
(
false
))
{
headers
.
contentDisposition
()
->
from7BitString
(
decryptedNode
->
contentDisposition
()
->
as7BitString
(
false
));
headers
.
contentDisposition
()
->
from7BitString
(
decryptedNode
->
contentDisposition
(
false
)
->
as7BitString
(
false
));
}
else
{
headers
.
removeHeader
<
KMime
::
Headers
::
ContentDisposition
>
();
}
if
(
decryptedNode
->
contentDescription
(
false
))
{
headers
.
contentDescription
()
->
from7BitString
(
decryptedNode
->
contentDescription
()
->
as7BitString
(
false
));
headers
.
contentDescription
()
->
from7BitString
(
decryptedNode
->
contentDescription
(
false
)
->
as7BitString
(
false
));
}
else
{
headers
.
removeHeader
<
KMime
::
Headers
::
ContentDescription
>
();
}
...
...
templateparser/src/templateparserjob.cpp
View file @
f140496f
...
...
@@ -1195,8 +1195,9 @@ KMime::Content *TemplateParserJob::createMultipartMixed(const QVector<KMime::Con
{
KMime
::
Content
*
mixedPart
=
new
KMime
::
Content
(
d
->
mMsg
.
data
());
const
QByteArray
boundary
=
KMime
::
multiPartBoundary
();
mixedPart
->
contentType
()
->
setMimeType
(
"multipart/mixed"
);
mixedPart
->
contentType
()
->
setBoundary
(
boundary
);
auto
contentType
=
mixedPart
->
contentType
();
contentType
->
setMimeType
(
"multipart/mixed"
);
contentType
->
setBoundary
(
boundary
);
mixedPart
->
contentTransferEncoding
()
->
setEncoding
(
KMime
::
Headers
::
CE7Bit
);
mixedPart
->
addContent
(
textPart
);
...
...
@@ -1205,10 +1206,10 @@ KMime::Content *TemplateParserJob::createMultipartMixed(const QVector<KMime::Con
mixedPart
->
addContent
(
attachment
);
// If the content type has no name or filename parameter, add one, since otherwise the name
// would be empty in the attachment view of the composer, which looks confusing
if
(
attachment
->
contentType
(
false
))
{
if
(
!
attachment
->
contentType
()
->
hasParameter
(
QStringLiteral
(
"name"
))
&&
!
attachment
->
contentType
()
->
hasParameter
(
QStringLiteral
(
"filename"
)))
{
attachment
->
contentType
()
->
setParameter
(
if
(
auto
ct
=
attachment
->
contentType
(
false
))
{
if
(
!
ct
->
hasParameter
(
QStringLiteral
(
"name"
))
&&
!
ct
->
hasParameter
(
QStringLiteral
(
"filename"
)))
{
ct
->
setParameter
(
QStringLiteral
(
"name"
),
i18nc
(
"@item:intext"
,
"Attachment %1"
,
attachmentNumber
));
}
}
...
...
@@ -1221,8 +1222,9 @@ KMime::Content *TemplateParserJob::createMultipartRelated(const MessageCore::Ima
{
KMime
::
Content
*
relatedPart
=
new
KMime
::
Content
(
d
->
mMsg
.
data
());
const
QByteArray
boundary
=
KMime
::
multiPartBoundary
();
relatedPart
->
contentType
()
->
setMimeType
(
"multipart/related"
);
relatedPart
->
contentType
()
->
setBoundary
(
boundary
);
auto
contentType
=
relatedPart
->
contentType
();
contentType
->
setMimeType
(
"multipart/related"
);
contentType
->
setBoundary
(
boundary
);
relatedPart
->
contentTransferEncoding
()
->
setEncoding
(
KMime
::
Headers
::
CE7Bit
);
relatedPart
->
addContent
(
mainTextPart
);
for
(
KMime
::
Content
*
image
:
ic
.
images
())
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment