Skip to content

Commit

Permalink
Merge pull request #5602 from nextcloud/bug/noid/exclude-pgp-and-othe…
Browse files Browse the repository at this point in the history
…r-keys

Exclude pgp signtures as attachments
  • Loading branch information
st3iny authored Dec 4, 2023
2 parents 6fb08e0 + 14bc67e commit 34b4a71
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/IMAP/ImapMessageFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,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,
Expand Down

0 comments on commit 34b4a71

Please sign in to comment.