Bug #92053
closedTest Mail Setup: Serializer Exception
100%
Description
This are my settings:
MAIL: transport: smtp transport_smtp_server: 'localhost:25' transport_spool_type: file transport_spool_filepath: spool
Setting transport_spool_type and transport_spool_filepath leads to the error message when i try to send a testmail from Environment->Test Mail Setup
Could not deliver mail Please verify $GLOBALS['TYPO3_CONF_VARS']['MAIL'][*] settings are valid. Error message: Serialization of 'Generator' is not allowed
Updated by Simon Gilli about 4 years ago
- Category changed from Install Tool to Miscellaneous
- Status changed from New to Accepted
There are two problems here.
The first one comes from the Symfony mailer, the serialization of Symfony\Component\Mime\RawMessage is broken. Looks like the following change can solve the issue:
public function __serialize(): array
{
return [$this->toString()];
}
See https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Mime/RawMessage.php#L79-L82
The second problem is located in TYPO3\CMS\Core\Mail\FileSpool line 165:
$transport->send($message->getMessage(), $message->getEnvelope());
See https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/core/Classes/Mail/FileSpool.php#L165
Updated by Simon Gilli about 4 years ago
The issue for Symfony is here https://github.com/symfony/symfony/issues/38430
Updated by Simon Gilli about 4 years ago
My changes for Symfony were approved and should get into the next release hopefully see https://github.com/symfony/symfony/pull/38433
Will also push the fix for the core in some minutes...
Updated by Gerrit Code Review about 4 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/66058
Updated by Gerrit Code Review about 4 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/66058
Updated by Simon Gilli about 4 years ago
Testing instructions¶
Change the global settings for MAIL:- Set 'transport_spool_type' -> 'file'
- Set 'transport_spool_filepath' -> 'spool'
- Send a test mail in the admin tool
- Add a scheduler task to send the mails and run it directly in the scheduler or via CLI
Without the patch the second step will fail with an exception. The first step is related to the Symfony issue and fails as long as no new release was made, should be included with 5.1.8 / 5.2.0 and 4.4.16.
Updated by Christoph Lehmann about 4 years ago
I checked it. My Settings are
'MAIL' => [ 'defaultMailFromAddress' => 'test@foo.bar', 'defaultMailFromName' => 'Hans Dampf', 'defaultMailReplyToAddress' => 'test@foo.bar', 'defaultMailReplyToName' => 'Hans Dampf Reply', 'transport' => 'smtp', 'transport_sendmail_command' => '/usr/sbin/sendmail -t -i ', 'transport_smtp_encrypt' => false, 'transport_smtp_password' => '', 'transport_smtp_server' => 'localhost:1025', 'transport_smtp_username' => '', 'transport_spool_filepath' => 'spool', 'transport_spool_type' => 'file', ],
with PHP 7.2 and 7.3
i) I added both patches
ii) Send a testmail
Got green flashmessage (success).
Got 5 new files in spool directory
LkIDdbt2O8.message
LkIDdbt2O8C.message
LkIDdbt2O8C_.message
LkIDdbt2O8C_r.message
LkIDdbt2O8C_rN.message
iii) Run /typo3/sysext/core/bin/typo3 mailer:spool:send
Got output:
// 5 emails sent
And have 5 new Mails
There seems to be something else broken, because i only klicked one time and got 5 new mails. Checked browser console too, it was only one POST request.
The patches work, but we need to update the composer dependeny
Updated by Christoph Lehmann about 4 years ago
I got 5 mails because of https://forge.typo3.org/issues/91764 which is fixed.Maybe you could review it too.
State of this ticket: Waiting for a new release 5.1.8 / 5.2.0 / 4.4.16 of symfony/mailer dependency
Updated by Gerrit Code Review about 4 years ago
Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/66122
Updated by Simon Gilli about 4 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 959e79de9163e0363f41970b0b905d69c3abfd70.
Updated by Simon Gilli about 4 years ago
- Related to Bug #91763: Mail file spool is broken added
Updated by Simon Gilli about 4 years ago
- Related to Bug #92839: mailmessage send via spoolfile added
Updated by Benni Mack almost 4 years ago
- Status changed from Resolved to Closed