From 55e9e243c3be0e4715860eee0e2ca9ac42346dd9 Mon Sep 17 00:00:00 2001 From: Ian Otto Date: Wed, 31 May 2017 12:31:48 -0700 Subject: [PATCH 1/4] Make sure to not decode subparts of an attachment This causes an issue when the subpart is an attachment that is an RFC822 file. This resolves this issue. --- src/PhpImap/Mailbox.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhpImap/Mailbox.php b/src/PhpImap/Mailbox.php index ca15d935..e56a676f 100644 --- a/src/PhpImap/Mailbox.php +++ b/src/PhpImap/Mailbox.php @@ -614,7 +614,7 @@ protected function initMailPart(IncomingMail $mail, $partStructure, $partNum, $m } if(!empty($partStructure->parts)) { foreach($partStructure->parts as $subPartNum => $subPartStructure) { - if($partStructure->type == 2 && $partStructure->subtype == 'RFC822') { + if($partStructure->type == 2 && $partStructure->subtype == 'RFC822' && && $partStructure->disposition !== "attachment") { $this->initMailPart($mail, $subPartStructure, $partNum, $markAsSeen); } else { From 29ab05cd9e361b2482d9c0409ed50822ff005590 Mon Sep 17 00:00:00 2001 From: Ian Otto Date: Wed, 31 May 2017 12:35:14 -0700 Subject: [PATCH 2/4] Syntax Error Fix Fix syntax error I didn't notice till too late --- src/PhpImap/Mailbox.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PhpImap/Mailbox.php b/src/PhpImap/Mailbox.php index e56a676f..6c17087e 100644 --- a/src/PhpImap/Mailbox.php +++ b/src/PhpImap/Mailbox.php @@ -15,7 +15,7 @@ class Mailbox { protected $imapRetriesNum = 0; protected $imapParams = array(); protected $serverEncoding; - protected $attachmentsDir = null; + protected $sDir = null; protected $expungeOnDisconnect = true; private $imapStream; @@ -614,7 +614,7 @@ protected function initMailPart(IncomingMail $mail, $partStructure, $partNum, $m } if(!empty($partStructure->parts)) { foreach($partStructure->parts as $subPartNum => $subPartStructure) { - if($partStructure->type == 2 && $partStructure->subtype == 'RFC822' && && $partStructure->disposition !== "attachment") { + if($partStructure->type == 2 && $partStructure->subtype == 'RFC822' && $partStructure->disposition !== "attachment") { $this->initMailPart($mail, $subPartStructure, $partNum, $markAsSeen); } else { From 90a0fe0a88fbb1346ab24cec93e1420ebeb5a515 Mon Sep 17 00:00:00 2001 From: Ian Otto Date: Wed, 31 May 2017 12:38:51 -0700 Subject: [PATCH 3/4] Update Mailbox.php --- src/PhpImap/Mailbox.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PhpImap/Mailbox.php b/src/PhpImap/Mailbox.php index 6c17087e..7b775a50 100644 --- a/src/PhpImap/Mailbox.php +++ b/src/PhpImap/Mailbox.php @@ -15,6 +15,7 @@ class Mailbox { protected $imapRetriesNum = 0; protected $imapParams = array(); protected $serverEncoding; + protected $attachmentsDir = null; protected $sDir = null; protected $expungeOnDisconnect = true; private $imapStream; From b58966d90ac5ca6c296c01cb36a6b6f825417021 Mon Sep 17 00:00:00 2001 From: Ian Otto Date: Wed, 23 Aug 2017 00:53:49 -0700 Subject: [PATCH 4/4] Remove unused variable --- src/PhpImap/Mailbox.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/PhpImap/Mailbox.php b/src/PhpImap/Mailbox.php index 7b775a50..4fd00af2 100644 --- a/src/PhpImap/Mailbox.php +++ b/src/PhpImap/Mailbox.php @@ -16,7 +16,6 @@ class Mailbox { protected $imapParams = array(); protected $serverEncoding; protected $attachmentsDir = null; - protected $sDir = null; protected $expungeOnDisconnect = true; private $imapStream;