From 1dd1ff84aa2714fbe2a5f832cfdb129d64dfc1a5 Mon Sep 17 00:00:00 2001 From: Christian Bartels Date: Thu, 10 Aug 2017 09:11:29 +0200 Subject: [PATCH 1/2] Avoid php error when host is missing resolves #181 --- src/Fetch/Message.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Fetch/Message.php b/src/Fetch/Message.php index e382678..cb5ae10 100755 --- a/src/Fetch/Message.php +++ b/src/Fetch/Message.php @@ -672,7 +672,7 @@ protected function processAddressObject($addresses) foreach ($addresses as $address) { if (property_exists($address, 'mailbox') && $address->mailbox != 'undisclosed-recipients') { $currentAddress = array(); - $currentAddress['address'] = $address->mailbox . '@' . $address->host; + $currentAddress['address'] = $address->mailbox . (property_exists($address, 'host') ? '@' . $address->host : ''); if (isset($address->personal)) { $currentAddress['name'] = MIME::decode($address->personal, self::$charset); } From d02800d21d710b9ad4c28af3bae55fb7f1d62672 Mon Sep 17 00:00:00 2001 From: Christian Bartels Date: Thu, 10 Aug 2017 09:14:26 +0200 Subject: [PATCH 2/2] Remove detection of undisclosed recipients This commit partly reverts naive approach to detect undisclosed recipients that was introduced in #37203c6. Depending on the mail client various versions of the "undisclosed-recipients" are known. E.g. a german Thunderbird puts "To: Verborgene_Empfaenger: ;" into the header. --- src/Fetch/Message.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Fetch/Message.php b/src/Fetch/Message.php index cb5ae10..4d99f30 100755 --- a/src/Fetch/Message.php +++ b/src/Fetch/Message.php @@ -670,7 +670,7 @@ protected function processAddressObject($addresses) $outputAddresses = array(); if (is_array($addresses)) foreach ($addresses as $address) { - if (property_exists($address, 'mailbox') && $address->mailbox != 'undisclosed-recipients') { + if (property_exists($address, 'mailbox')) { $currentAddress = array(); $currentAddress['address'] = $address->mailbox . (property_exists($address, 'host') ? '@' . $address->host : ''); if (isset($address->personal)) {