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
$content = "From user@example.com ".@date("D M d H:i:s Y")."\n";
$content .= stream_get_content(STDIN);
$parser = new MailMimeParser();
$message = $parser->parse($content,FALSE);
<perform actions on $message>
$result .= $message->__toString();
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?)
From user@example.com Wed Sep 04 01: 31:55 2024
Workaround is not to pass the content with the "From" line through the __toString() function, that is:
$content = stream_get_content(STDIN);
$parser = new MailMimeParser();
$message = $parser->parse($content,FALSE);
<perform actions on $message>
$output = $message->__toString();
$result = "From user@example.com ".@date("D M d H:i:s Y")."\n";
$result .= $output;
This gives the "From" line correctly, without the weird space:
From user@example.com Wed Sep 04 01:31:55 2024
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: