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
I use this imap library (which is fantastic by the way), to automatically parse/process email coming in to a specific email account in Office 365. Lately, I've noticed that the "References:" header (which I look at to know if I've already processed an email already) has references that are comma-separated as opposed to space separated and the snippet of code in this library explodes references by space. Perhaps we need to explode by both space and comma? I'm not sure if Outlook servers are adding the comma, or the email is arriving like that.
Current behavior
Currently, the library explodes the references header by space:
/**
* Get message References (from headers).
*
* @return string[]
*/
final public function getReferences(): array
{
$references = $this->getHeaders()->get('references');
\assert(null === $references || \is_string($references));
return null !== $references ? \explode(' ', $references) : [];
}
How to reproduce: code & error stack trace
An email with comma-separated references in the header will not parse correctly when using the getReferences() function.
Expected behavior
The references in the header would be exploded either by comma or space and result in a clean array of references.
Thanks!
The text was updated successfully, but these errors were encountered:
Summary
I use this imap library (which is fantastic by the way), to automatically parse/process email coming in to a specific email account in Office 365. Lately, I've noticed that the "References:" header (which I look at to know if I've already processed an email already) has references that are comma-separated as opposed to space separated and the snippet of code in this library explodes references by space. Perhaps we need to explode by both space and comma? I'm not sure if Outlook servers are adding the comma, or the email is arriving like that.
Current behavior
Currently, the library explodes the references header by space:
How to reproduce: code & error stack trace
An email with comma-separated references in the header will not parse correctly when using the
getReferences()
function.Expected behavior
The references in the header would be exploded either by comma or space and result in a clean array of references.
Thanks!
The text was updated successfully, but these errors were encountered: