#24917encrypted SMTP: Requirement check missing
Description
There is no check, if the environment supports encryption. In t3lib_mail_Mailer $useEncryption is directly taken out of $GLOBALS[‘TYPO3_CONF_VARS’][‘MAIL’]. Without proper openSSL, this results in an error:
Core: Exception handler (WEB): Uncaught TYPO3 Exception: Connection could not be established with host example.com [Unable to find the socket transport “tls” – did you forget to enable it when you configured PHP? #5] | Swift_TransportException thrown in file /var/www/id1234/files/typo3_src-4.5.0/typo3/contrib/swiftmailer/classes/Swift/Transport/StreamBuffer.php in line 235
For SSL or TLS encryption to work, PHP installations must have appropriate OpenSSL transports wrappers. You can check if “tls” and/or “ssl” are present in your PHP installation by using the PHP function stream_get_transports().
Old:
$useEncryption = ($mailSettings[‘transport_smtp_encrypt’] ? TRUE : FALSE);
New:
if (in_array(‘tls’, stream_get_transports())) {
$useEncryption = ($mailSettings[‘transport_smtp_encrypt’] ? TRUE : FALSE);
}
(issue imported from #M17432)
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.