From 5514264914742f012a7226be1086bfc17275657c Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Thu, 3 Feb 2022 17:04:10 +0100 Subject: [PATCH] #89 Bugfix mime and signatures detection --- dev/View/User/MailBox/MessageView.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/View/User/MailBox/MessageView.js b/dev/View/User/MailBox/MessageView.js index 7ea130f7c..7e228d0ac 100644 --- a/dev/View/User/MailBox/MessageView.js +++ b/dev/View/User/MailBox/MessageView.js @@ -62,7 +62,7 @@ const mimeToMessage = (data, message) => { // TODO: Check multipart/signed application/pgp-signature application/pgp-keys const headers = data.split(/\r?\n\r?\n/)[0]; - if (/Content-Type:.+; boundary=/.test(headers)) { + if (/Content-Type:[\s\S]*?;\s*boundary=/.test(headers)) { // https://github.com/postalsys/postal-mime (new PostalMime).parse(data).then(result => { // TODO: multipart/signed @@ -634,7 +634,7 @@ export class MailMessageView extends AbstractViewRight { PgpUserStore.decrypt(oMessage).then(result => { if (result && result.data) { mimeToMessage(result.data, oMessage); - if (result.signatures) { + if (result.signatures && result.signatures.length) { oMessage.pgpSigned(true); oMessage.pgpVerified({ signatures: result.signatures,