diff --git a/src/IMAP/Message.php b/src/IMAP/Message.php index f7f9c12..50d1c2a 100644 --- a/src/IMAP/Message.php +++ b/src/IMAP/Message.php @@ -602,13 +602,15 @@ private function parseAddresses($list) { } if (!property_exists($address, 'personal')) { $address->personal = false; - } - - $personalParts = imap_mime_header_decode($address->personal); + } else { + $personalParts = imap_mime_header_decode($address->personal); - $address->personal = ''; - foreach ($personalParts as $p) { - $address->personal .= $p->text; + if(is_array($personalParts)) { + $address->personal = ''; + foreach ($personalParts as $p) { + $address->personal .= $p->text; + } + } } $address->mail = ($address->mailbox && $address->host) ? $address->mailbox.'@'.$address->host : false;