Open mwyres opened 2 months ago
This library only parses mime messages, the first "SMTP" line shouldn't be passed to $parser->parse in your example, it should be filtered out.
As in it is treating that first line as:
From user@example.com Wed Sep 04 01:
...as the header name, adding the space, and then:
31:55 2024
...as the value of the header, given it's after the first colon.
Make sense - relatively easy to workaround, but would be a "nice to have" if it could work around it.
Weird modification to the "From" line:
The resulting "From" line in $result comes back with weird additional spaces in the date - (note the weird space in between hours and minutes in the formatted date string?)
Workaround is not to pass the content with the "From" line through the __toString() function, that is:
This gives the "From" line correctly, without the weird space:
Given there is a workaround, this is not a critical issue, but somewhere between the creation of MimeMailParser object, and the output using __toString, the "From" line is being handled weirdly.
Note, this is not the "From:" header from further down - this is the very first line that appears at the top of emails after processing via Postfix, and needs to exist if you are post-processing back through Postfix.
Happy to explain further if this isn't completely clear.