Bug #31998
faulty check for missing SMTP-port
Status: | Resolved | Start date: | 2011-11-22 | |
---|---|---|---|---|
Priority: | Must have | Due date: | ||
Assigned To: | - | % Done: | 100% |
|
Category: | Backend API | Spent time: | - | |
Target version: | - | |||
TYPO3 Version: | 4.5 | Is Regression: | ||
PHP Version: | 5.2 | Sprint Focus: | ||
Complexity: | no-brainer |
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,
Related issues
Associated revisions
[BUGFIX] Faulty check for missing SMTP port
Check also for null port to avoid a fatal error.
Resolves: #31998
Releases: 6.2, 6.1, 6.0, 4.7, 4.5
Change-Id: Ibf45b3c0783a70e5afba33f90d1d8e05f76834cf
Reviewed-on: https://review.typo3.org/23504
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
[BUGFIX] Faulty check for missing SMTP port
Check also for null port to avoid a fatal error.
Resolves: #31998
Releases: 6.2, 6.1, 6.0, 4.7, 4.5
Change-Id: Ibf45b3c0783a70e5afba33f90d1d8e05f76834cf
Reviewed-on: https://review.typo3.org/23515
Reviewed-by: Tomita Militaru
Tested-by: Tomita Militaru
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
[BUGFIX] Faulty check for missing SMTP port
Check also for null port to avoid a fatal error.
Resolves: #31998
Releases: 6.2, 6.1, 6.0, 4.7, 4.5
Change-Id: Ibf45b3c0783a70e5afba33f90d1d8e05f76834cf
Reviewed-on: https://review.typo3.org/23516
Reviewed-by: Tomita Militaru
Tested-by: Tomita Militaru
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
[BUGFIX] Faulty check for missing SMTP port
Check also for null port to avoid a fatal error.
Resolves: #31998
Releases: 6.2, 6.1, 6.0, 4.7, 4.5
Change-Id: Ibf45b3c0783a70e5afba33f90d1d8e05f76834cf
Reviewed-on: https://review.typo3.org/23517
Reviewed-by: Markus Klein
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
[BUGFIX] Faulty check for missing SMTP port
Check also for null port to avoid a fatal error.
Resolves: #31998
Releases: 6.2, 6.1, 6.0, 4.7, 4.5
Change-Id: Ibf45b3c0783a70e5afba33f90d1d8e05f76834cf
Reviewed-on: https://review.typo3.org/23518
Reviewed-by: Markus Klein
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
[BUGFIX] Namespace usage in test
Patch for issue #31998 introduced a namespace in unit test,
the test suite now fails after patch for issue #53682. Use
old class name instead.
Change-Id: I83e7cd33787364c1f531c51406f09884aff418c6
Resolves: #55811
Related: #53682
Related: #31998
Releases: 4.7, 4.5
Reviewed-on: https://review.typo3.org/27513
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
[BUGFIX] Namespace usage in test
Patch for issue #31998 introduced a namespace in unit test,
the test suite now fails after patch for issue #53682. Use
old class name instead.
Change-Id: I83e7cd33787364c1f531c51406f09884aff418c6
Resolves: #55811
Related: #53682
Related: #31998
Releases: 4.7, 4.5
Reviewed-on: https://review.typo3.org/27513
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
(cherry picked from commit df8e21b7e727d7ec709ed9f92e3069d77db0be04)
Reviewed-on: https://review.typo3.org/27514
History
#1 Updated by Philipp Gampe about 2 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
#2 Updated by Gerrit Code Review almost 2 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
#3 Updated by Gerrit Code Review almost 2 years ago
Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23504
#4 Updated by Gerrit Code Review almost 2 years ago
Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23504
#5 Updated by Gerrit Code Review almost 2 years ago
Patch set 4 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23504
#6 Updated by Gerrit Code Review almost 2 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
#7 Updated by Gerrit Code Review almost 2 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
#8 Updated by Tomita Militaru almost 2 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset f9ad22701ba5454eef10bcddd81e7e1f9b3f8a1b.
#9 Updated by Gerrit Code Review almost 2 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
#10 Updated by Gerrit Code Review almost 2 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
#11 Updated by Gerrit Code Review almost 2 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
#12 Updated by Tomita Militaru almost 2 years ago
- Status changed from Under Review to Resolved
Applied in changeset 55724fb1487458defba87b93fb5dfdd117230e4a.