Project

General

Profile

Actions

Bug #31998

closed

faulty check for missing SMTP-port

Added by Julian Hofmann over 12 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Backend API
Target version:
-
Start date:
2011-11-22
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
5.2
Tags:
Complexity:
no-brainer
Is Regression:
Sprint Focus:

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 1 (0 open1 closed)

Related to TYPO3 Core - Bug #55811: Namespace usage in 4.7Closed2014-02-09

Actions
Actions #1

Updated by Philipp Gampe over 10 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
Actions #2

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

Actions #3

Updated by Gerrit Code Review over 10 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23504

Actions #4

Updated by Gerrit Code Review over 10 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23504

Actions #5

Updated by Gerrit Code Review over 10 years ago

Patch set 4 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23504

Actions #6

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

Actions #7

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

Actions #8

Updated by Tomita Militaru over 10 years ago

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

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

Actions #10

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

Actions #11

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

Actions #12

Updated by Tomita Militaru over 10 years ago

  • Status changed from Under Review to Resolved
Actions #13

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF