Skip to content

Commit

Permalink
Merge pull request #9134 from nextcloud/backport/5602/stable3.5
Browse files Browse the repository at this point in the history
[stable3.5] Exclude pgp signtures as attachments
  • Loading branch information
st3iny authored Dec 4, 2023
2 parents bb2560e + a7ebb9a commit ca8e8ed
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 ca8e8ed

Please sign in to comment.