Project

General

Profile

Actions

Bug #92053

closed

Test Mail Setup: Serializer Exception

Added by Christoph Lehmann over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Miscellaneous
Target version:
-
Start date:
2020-08-20
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #91763: Mail file spool is brokenClosed2020-07-08

Actions
Related to TYPO3 Core - Bug #92839: mailmessage send via spoolfileClosed2020-11-14

Actions
Actions #1

Updated by Oliver Hader over 3 years ago

  • Category set to Install Tool
Actions #2

Updated by Simon Gilli over 3 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

Actions #3

Updated by Simon Gilli over 3 years ago

Actions #4

Updated by Simon Gilli over 3 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...

Actions #5

Updated by Gerrit Code Review over 3 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

Actions #6

Updated by Gerrit Code Review over 3 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

Actions #7

Updated by Simon Gilli over 3 years ago

Testing instructions

Change the global settings for MAIL:
  • Set 'transport_spool_type' -> 'file'
  • Set 'transport_spool_filepath' -> 'spool'
Do the following testing steps:
  • 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.

Actions #8

Updated by Christoph Lehmann over 3 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

Actions #9

Updated by Christoph Lehmann over 3 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

Actions #10

Updated by Gerrit Code Review over 3 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

Actions #11

Updated by Simon Gilli over 3 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #12

Updated by Simon Gilli over 3 years ago

  • Related to Bug #91763: Mail file spool is broken added
Actions #13

Updated by Simon Gilli over 3 years ago

  • Related to Bug #92839: mailmessage send via spoolfile added
Actions #14

Updated by Benni Mack over 3 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF