You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider following From: header of a message From: Something: Somewhere <[email protected]>. When this kind of message is read, PHP Catchable fatal error: Method Ddeboer\Imap\Message\EmailAddress::__toString() must return a string value is thrown.
It seems that PHP's native imap_headerinfo() parses this kind of address line incorrectly. When putting print_r($value) to the header parsing script vendor/ddeboer/imap/src/Message/Headers.php the output is:
I think I do not have the original message anymore to copy-paste the raw headers here.
As it has been a while since last update, I searched through the codebase and could not find imap_headerinfo() call anywhere. Before anybody gets confused as I was, must clarify that https://github.com/ddeboer/imap/blob/master/src/Message.php#L184imap_header() is alias to imap_headerinfo() . ;)
The format without the double-quotes is not valid and we can't do anything to fix it (except complex parsing of raw headers or throwing away the imap extension).
We have removed the __toString() function: use the getAddress() from now so at least you can catch handle graceful the error.
Consider following From: header of a message
From: Something: Somewhere <[email protected]>
. When this kind of message is read,PHP Catchable fatal error: Method Ddeboer\Imap\Message\EmailAddress::__toString() must return a string value
is thrown.It seems that PHP's native
imap_headerinfo()
parses this kind of address line incorrectly. When puttingprint_r($value)
to the header parsing scriptvendor/ddeboer/imap/src/Message/Headers.php
the output is:The text was updated successfully, but these errors were encountered: