Bug #31998
closedfaulty check for missing SMTP-port
100%
Description
The install tool explains for $TYPO3_CONF_VARS['MAIL']['transport_smtp_server']:
<server:port> of mailserver to connect to. <port> defaults to "25".
In fact a missing port will not being set to the default SMTP-port (25), but will result in a fatal error:
Warning: fsockopen() [function.fsockopen]: unable to connect to mail.example.org:0 (Failed to parse address "mail.example.org") in (...)/typo3/contrib/swiftmailer/classes/Swift/Transport/StreamBuffer.php on line 233 Fatal error: Uncaught exception 'Swift_TransportException' with message 'Connection could not be established with host mail.example.org [Failed to parse address "mail.example.org" #0]' in (...)/typo3/contrib/swiftmailer/classes/Swift/Transport/StreamBuffer.php:235 (...)
preg_split in t3lib_mail_Mailer::initializeTransport() returns in case of a missing port (and missing colon) for the second part ($port) NULL. Later in this method $port is checked to be an empty string and in that case it would be set to '25'. Because NULL is not a string this does not match, if the port and the colon is missing.
Instead of checking $port==='' it should be ($port==NULL || $port==='').
Tested on:
- Xampp, PHP 5.3.5, Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1
- MAMP, PHP 5.3.6,
Updated by Philipp Gampe over 11 years ago
- Category set to Backend API
- Status changed from New to Accepted
- PHP Version changed from 5.3 to 5.2
- Complexity set to no-brainer
Updated by Gerrit Code Review over 11 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23504
Updated by Gerrit Code Review over 11 years ago
Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23504
Updated by Gerrit Code Review over 11 years ago
Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23504
Updated by Gerrit Code Review over 11 years ago
Patch set 4 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23504
Updated by Gerrit Code Review over 11 years ago
Patch set 1 for branch TYPO3_6-1 has been pushed to the review server.
It is available at https://review.typo3.org/23515
Updated by Gerrit Code Review over 11 years ago
Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/23516
Updated by Tomita Militaru over 11 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset f9ad22701ba5454eef10bcddd81e7e1f9b3f8a1b.
Updated by Gerrit Code Review over 11 years ago
- Status changed from Resolved to Under Review
Patch set 1 for branch TYPO3_4-7 has been pushed to the review server.
It is available at https://review.typo3.org/23517
Updated by Gerrit Code Review over 11 years ago
Patch set 2 for branch TYPO3_4-7 has been pushed to the review server.
It is available at https://review.typo3.org/23517
Updated by Gerrit Code Review over 11 years ago
Patch set 1 for branch TYPO3_4-5 has been pushed to the review server.
It is available at https://review.typo3.org/23518
Updated by Tomita Militaru over 11 years ago
- Status changed from Under Review to Resolved
Applied in changeset 55724fb1487458defba87b93fb5dfdd117230e4a.