From 14bc67e81f5f5b645b28a76f69e7af64a913a2c2 Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Fri, 1 Oct 2021 22:41:28 +0200 Subject: [PATCH] Exclude pgp signtures as attachments Signed-off-by: Daniel Kesselberg --- lib/IMAP/ImapMessageFetcher.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/IMAP/ImapMessageFetcher.php b/lib/IMAP/ImapMessageFetcher.php index 4d38dd2f79..0d476329e8 100644 --- a/lib/IMAP/ImapMessageFetcher.php +++ b/lib/IMAP/ImapMessageFetcher.php @@ -314,8 +314,11 @@ private function getPart(Horde_Mime_Part $p, string $partNo, bool $isFetched): v } } + $isAttachment = ($p->isAttachment() || $p->getType() === 'message/rfc822') && + !in_array($p->getType(), ['application/pgp-signature', 'application/pkcs7-signature', 'application/x-pkcs7-signature']); + // Regular attachments - if ($p->isAttachment() || $p->getType() === 'message/rfc822') { + if ($isAttachment) { $this->attachments[] = [ 'id' => $p->getMimeId(), 'messageId' => $this->uid,