-
-
Notifications
You must be signed in to change notification settings - Fork 184
Description
Describe the bug
I'm using laravel however this seems to be a php-imap issue so I will post it here. The connection used was gmail with the settings described in the wiki (app-password)
mb_decode_mimeheader() expects parameter 1 to be string, array given
on src/Header.php private function decode($value)
on line 388
I have traced the issue back to 'References:' raw header
On normal emails, there is only one reference but some emails can have a hierarchy of emails in them so it picks up multiple references. This causes the public function rfc822_parse_headers($raw_headers) on line 171 to parse 'References:' as an array rather than a string.
To Reproduce
Steps to reproduce the behavior:
- use gmail connection (app password)
$client->connect();
return $client->getFolders('folder name')->messages()->all()->get();
- emails with multiple references will fail on mb_decode_mimeheader()
Desktop / Server (please complete the following information):
- OS: macos 10.15.7 (19H2)
- PHP: 7.4.13
Additional context
This only happens when an email contains multiple 'References:' on a single reference the behaviour is normal with out any issues.
