-
Notifications
You must be signed in to change notification settings - Fork 111
tests: Mail\Message produced output not usable by Storage\Message #159
base: master
Are you sure you want to change the base?
Conversation
zendframework/zend-mail#159 Current workaround is to split headers+body ourselves from raw message.
zendframework/zend-mail#159 Current workaround is to split headers+body ourselves from raw message.
zendframework/zend-mail#159 Current workaround is to split headers+body ourselves from raw message.
$part->charset = 'UTF-8'; | ||
|
||
$mime = new Mime\Message(); | ||
$mime->addPart($part); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
None of the preceding 7 lines are ever used within the test. Is your setup missing something (attaching a MIME part to the message)? Or can the lines be removed safely?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think they can be removed as the reproducer worked. otherwise i wouldn't had pushed it this way.
$raw = $message->toString(); | ||
$this->assertContains($text, $raw, "original text is preserved"); | ||
|
||
$message = new Storage\Message(['raw' => $raw]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a Zend\Mime\Decode::splitMessage()
issue.
Zend\Mail\Storage\Part
calls on that method to split the message into headers and content. My suspicion is that it's searching until the last occurence of the \n\n
sequence, instead of the first.
Can you please try and create and post a reproduce case against the zend-mime component? Thanks in advance!
This repository has been moved to laminas/laminas-mail. If you feel that this patch is still relevant, please re-open against that repository, and reference this issue. To re-open, we suggest the following workflow:
|
This repository has been closed and moved to laminas/laminas-mail; a new issue has been opened at laminas/laminas-mail#43. |
this shows the problem zend-mail is having:
mail created with
Mail\Message
and serialized into rawand then loaded with
Storage\Message
causes parse error if the$text
contains double unix newlines (\n\n
).this throws on
$message = new Storage\Message(['raw' => $raw]);
`