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
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
This PR was squashed before being merged into the 4.4 branch.
Discussion
----------
[Mime] Fix serialization of RawMessage
| Q | A
| ------------- | ---
| Branch? | 4.4 <!-- see below -->
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | Fix#38430, Related #33394 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT
| Doc PR | - <!-- required for new features -->
The serialization of RawMessage is currently broken if using a generator for message like done by `Symfony\Component\Mailer\SentMessage` see https://github.com/symfony/symfony/blob/5f1c3a797247a6d54992384df00bb22741fc1c34/src/Symfony/Component/Mailer/SentMessage.php#L45
This patch converts the message to a string so further serialization can be done.
This patch probably also solves #33394.
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.
Additionally (see https://symfony.com/releases):
- Always add tests and ensure they pass.
- Never break backward compatibility (see https://symfony.com/bc).
- Bug fixes must be submitted against the lowest maintained branch where they apply
(lowest branches are regularly merged to upper ones so they get the fixes too.)
- Features and deprecations must be submitted against branch 5.x.
-->
Commits
-------
fd99eb2 [Mime] Fix serialization of RawMessage
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 errorSerialization of 'Generator' is not allowed
is thrown. The problem here is the$raw
property which is a generator seesymfony/src/Symfony/Component/Mailer/SentMessage.php
Line 45 in 5f1c3a7
Afterwards if the method
__serialize()
ofSymfony\Component\Mime\RawMessage
gets called the generator is returned in the array instead of an array seesymfony/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:
I'm not fully aware of the impact here but I guess this could be a solution in general.
The text was updated successfully, but these errors were encountered: