Skip to content

Commit

Permalink
Exclude pgp signtures as attachments
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
  • Loading branch information
kesselb committed Jul 4, 2023
1 parent 8c3c248 commit 4ed234a
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 @@ -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,
Expand Down

0 comments on commit 4ed234a

Please sign in to comment.