From fec4c33c08210348246b3b3d4a7715e447553e0d Mon Sep 17 00:00:00 2001 From: stefansieg Date: Mon, 30 Nov 2026 18:22:51 +0100 Subject: [PATCH] Handle missing Content-Type in MIME parsing Prevent a TypeError when processing MIME parts without an explicit Content-Type header. --- dev/Mime/Utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/Mime/Utils.js b/dev/Mime/Utils.js index 70d76ecf88..8d95aad049 100644 --- a/dev/Mime/Utils.js +++ b/dev/Mime/Utils.js @@ -65,7 +65,7 @@ export function MimeToMessage(data, message) } else { message.attachments.push(attachment); } - } else if ('multipart/signed' === type.value) { + } else if ('multipart/signed' === type?.value) { let protocol = type.params.protocol; if ('application/pgp-signature' === protocol) { message.pgpSigned({ @@ -81,7 +81,7 @@ export function MimeToMessage(data, message) detached: true }); } - } else if ('application/pkcs7-mime' === type.value /*&& 'signed-data' === type.params['smime-type']=*/) { + } else if ('application/pkcs7-mime' === type?.value /*&& 'signed-data' === type.params['smime-type']=*/) { message.smimeSigned({ micAlg: type.micalg, bodyPart: part,