From 1d363799b4f373e8e7df10aedb9f9e7bebb0be70 Mon Sep 17 00:00:00 2001 From: Gordon Zhao Date: Mon, 20 Nov 2023 20:42:02 +1000 Subject: [PATCH] https://github.com/Webklex/php-imap/pull/372 --- src/Message.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Message.php b/src/Message.php index 4137db9a..35062266 100755 --- a/src/Message.php +++ b/src/Message.php @@ -589,7 +589,7 @@ protected function fetchAttachment(Part $part) { $oAttachment = new Attachment($this, $part); if ($oAttachment->getName() !== null && $oAttachment->getSize() > 0) { - if ($oAttachment->getId() !== null) { + if ($oAttachment->getId() !== null && $this->attachments->offsetExists($oAttachment->getId())) { $this->attachments->put($oAttachment->getId(), $oAttachment); } else { $this->attachments->push($oAttachment);