Project

General

Profile

Actions

Bug #23277

closed

Mailing doesn´t work with safe mode on

Added by Christoph Werner over 14 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2010-07-27
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.4
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

The bug was already explained in issue 14741 and is still reproduceable with Typo3 4.4.0

(issue imported from #M15247)


Files


Related issues 2 (0 open2 closed)

Has duplicate TYPO3 Core - Bug #22894: Install Tool does not send test mailsClosedSteffen Kamper2010-06-15

Actions
Is duplicate of TYPO3 Core - Bug #23925: Mail not sent with SAFE_MODE enabledClosedChristian Kuhn2010-11-03

Actions
Actions #1

Updated by Axel Kloss over 14 years ago

I have the same problem - and it happens even with 4.4.1

Actions #2

Updated by Michael Singer over 14 years ago

Since version 4.4.0 there is a new file in folder /typo3/t3lib:
class.t3lib_utility_mail.php

An array defines five parameters for sending mails, while safe_mode only allows four parameters. As a consequence, no mails are being sent neither by the install tool (sendmail test) nor by extensions like powermail etc.

As a dirty hack one has to replace line 69 in class.t3lib_utility_mail.php

$success = @mail($to, $subject, $messageBody, $additionalHeaders, $additionalParameters);

with:

$success = @mail($to, $subject, $messageBody, $additionalHeaders);

to get emails sent by TYPO3 again.

There has been no such problem with TYPO3 4.3.3.

In order to get sendmail to work with safe_mode, it would be nice, if the amount of parameters could be configured via the install tool or by hand in the localconfig.php.

Actions #3

Updated by Nico Tillmann over 14 years ago

We had the same problem since 4.4.0 on several website and it's also due to SAFE_MDOE restirctions

This would be my favoured solution for further 4.4.x branches:

diff wu t3lib/utility/class.t3lib_utility_mail.php-typo3original t3lib/utility/class.t3lib_utility_mail.php
--
t3lib/utility/class.t3lib_utility_mail.php-typo3original Mi Jul 28 11:32:12 2010
++ t3lib/utility/class.t3lib_utility_mail.php Do Aug 5 12:21:14 2010
@ -66,13 +66,19 @
$success = $success && t3lib_div::callUserFunction($hookMethod, $parameters, $fakeThis);
}
} else {
- $success = @mail($to, $subject, $messageBody, $additionalHeaders, $additionalParameters);
if( !ini_get('safe_mode') ) {
+ $success = mail($to, $subject, $messageBody, $additionalHeaders, $additionalParameters);
}
+ else{
+ $success = mail($to, $subject, $messageBody, $additionalHeaders );
+ }
+ }

if (!$success) {
t3lib_div::sysLog('Mail to "' . $email . '" could not be sent (Subject: "' . $subject . '").', 'Core', 3);
+
}
return $success;
}
}
Actions #4

Updated by Pim Snel about 14 years ago

I have the same problem. I thought almost everybody is running safemode.

Actions #5

Updated by Michael Singer about 14 years ago

for me, as long as the issue isn't resolved, this does the trick:

// eMail with SafeMode = ON
// Userfunction written on 04.07.2010 by J.Grewe
// add these lines to your localconfig.php:
if (!function_exists('user_fcmail')) {
$TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/utility/class.t3lib_utility_mail.php']['substituteMailDelivery'][] = 'user_fcmail';
function user_fcmail($parameters) {
$to = $parameters['to'];
$subject = $parameters['subject'];
$messageBody = $parameters['messageBody'];
$additionalHeaders = $parameters['additionalHeaders'];
$additionalParameters = $parameters['additionalParameters'];
$success = mail($to, $subject, $messageBody, $additionalHeaders);
return $success;
}
}

Actions #6

Updated by Andreas Kießling about 14 years ago

@Nico: Why don't you put your patch on the core list? I stumbled upon this from #23925.

The function did not change in 4.5, but in trunk is now a utility function which takes care of different settings that can be made for safe_mode... See http://bugs.typo3.org/view.php?id=4272 for that and http://forge.typo3.org/projects/typo3v4-core/repository/revisions/9221/entry/trunk/t3lib/utility/class.t3lib_utility_phpoptions.php for the patch.

Maybe you can "pimp" your patch to react on safe_mode = off too.

Actions #7

Updated by Steffen Gebert about 14 years ago

Resolved as duplicate of #23925

Actions #8

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF