Bug #23277
closedMailing doesn´t work with safe mode on
0%
Description
The bug was already explained in issue 14741 and is still reproduceable with Typo3 4.4.0
(issue imported from #M15247)
Files
Updated by Axel Kloss over 14 years ago
I have the same problem - and it happens even with 4.4.1
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.
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;
}
}
Updated by Pim Snel about 14 years ago
I have the same problem. I thought almost everybody is running safemode.
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;
}
}
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.