Description
We currently have an issue in the TYPO3 Core with our own implementation of the FileSpool inspired by Swift Mailer.
After a short investigation yesterday I have discovered the issue is coming from the serialization of the Symfony\Component\MailerSentMessage
where the error Serialization of 'Generator' is not allowed
is thrown. The problem here is the $raw
property which is a generator see
Afterwards if the method __serialize()
of Symfony\Component\Mime\RawMessage
gets called the generator is returned in the array instead of an array see
symfony/src/Symfony/Component/Mime/RawMessage.php
Lines 79 to 82 in 5f1c3a7
I changed that part during the debugging and for our use case that seems to work fine:
public function __serialize(): array
{
return [$this->toString()];
}
I'm not fully aware of the impact here but I guess this could be a solution in general.