Project

General

Profile

Actions

Feature #94544

closed

Allow more SMTP Configuration Settings (verify_peer)

Added by varioous OG almost 3 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Mailer API
Target version:
-
Start date:
2021-07-12
Due date:
% Done:

100%

Estimated time:
PHP Version:
7.4
Tags:
Complexity:
Sprint Focus:

Description

Hi,

I need to send SMTP-Mails with ssl and a self signed certificate. In default configuration from Backend test mail I always receive:

Core: Error handler (BE): PHP Warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed in /data/www/httpdocs/releases/2021-06-28_19 47/vendor/symfony/mailer/Transport/Smtp/Stream/SocketStream.php line 155

Now I added in the \TYPO3\CMS\Core\Mail\TransportFactory the options to disable verfify check:

$stream = $transport->getStream();
$streamOptions = $stream->getStreamOptions();
$streamOptions['ssl']['verify_peer'] = false;
$streamOptions['ssl']['verify_peer_name'] = false;
$stream->setStreamOptions($streamOptions);

With this change sending works great.

I wish that can add this settings in LocalConfiguration Mail Settings


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Feature #96034: Add Symfony mailer configurationClosed2021-11-18

Actions
Related to TYPO3 Core - Bug #96803: Use proper default config values for new mail settingsClosedBenni Mack2022-02-09

Actions
Actions #1

Updated by Guido Schmechel almost 3 years ago

I have a few questions about this:

- Where did you add these options? My guess is public function get(array $mailSettings) at the type "smtp"?
- Do you have an overview of all StreamOptions?

So that we can implement it in a meaningful way. I imagine an array in the AdditionalConfiguration, which is not editable by the Install Tool. Comparable to the HTTP options ([HTTP][proxy]). Here we have no UI on the part of the InstallTool.

Actions #2

Updated by Gerrit Code Review almost 3 years ago

  • Status changed from New 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/+/69907

Actions #3

Updated by Gerrit Code Review almost 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/+/69907

Actions #4

Updated by Gerrit Code Review almost 3 years ago

Patch set 3 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/+/69907

Actions #5

Updated by Guido Schmechel almost 3 years ago

I add a first approach. Maybe you can check this patch and add some feedback?

Actions #6

Updated by David Henninger over 2 years ago

I added the patch to my Typo3 10.4.21 setup and mail worked again after adding the new transport_smtp_stream_options to LocalConfiguration MAIL:

'MAIL' => [
    'transport'                     => 'smtp',
    'transport_sendmail_command'    => '/usr/sbin/sendmail -t -i ',
    'transport_smtp_encrypt'        => false,
    'transport_smtp_password'       => '',
    'transport_smtp_server'         => 'localhost:25',
    'transport_smtp_username'       => '',
    'transport_smtp_stream_options' => [
        'ssl' => [
            'verify_peer'      => false,
            'verify_peer_name' => false
        ]
    ]
]

However, the 'Configure Installation-Wide Options' in the install tool fails with the patch as "type: mixed" cannot handle the array above:

PHP Warning: mb_strlen() expects parameter 1 to be string, array given in typo3_src/typo3_src-10.4.21/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php line 3300

Also, some indentation spaces for the new options are missing in DefaultConfigurationDescription.yaml as well

P.S. yaml is the worst

Actions #7

Updated by Gerrit Code Review over 2 years ago

Patch set 4 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/+/69907

Actions #8

Updated by Gerrit Code Review over 2 years ago

Patch set 5 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/+/69907

Actions #9

Updated by Guido Schmechel over 2 years ago

Actions #10

Updated by Gerrit Code Review over 2 years ago

Patch set 6 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69907

Actions #11

Updated by Gerrit Code Review over 2 years ago

Patch set 7 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69907

Actions #12

Updated by Gerrit Code Review over 2 years ago

Patch set 8 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69907

Actions #13

Updated by Gerrit Code Review over 2 years ago

Patch set 9 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69907

Actions #14

Updated by Guido Schmechel over 2 years ago

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

Updated by Benni Mack about 2 years ago

  • Related to Bug #96803: Use proper default config values for new mail settings added
Actions #16

Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF