[TYPO3-dev] Ignoring warnings in T3 src, why ?
Jigal van Hemert
jigal at xs4all.nl
Fri Feb 11 23:09:41 CET 2011
Hi,
On 11-2-2011 21:30, Tomas Norre Mikkelsen wrote:
> I have a question regarding coding standard in the TYPO3-core.
>
> The other day I was trying to send some test-emails from my development
> server. Cause the server has safe_mode = on as default, the mails were
> not sent.
safe_mode is a bad concept [1] and should not be enabled.
> I found out that it was because of the safe_mode = on and the conditions
> in the t3lib_utility_Mail class[1] in the static mail function.
>
> If safe_mode is disable and the "$additionalParameters = null" then the
> mail is not sent.
In this case there is no extra parameter passed to sendmail and mails
can be rejected by the receiving server, etc.
> My question is, why is the @ used such warnings are ignored, if this was
> not set, It would have been easier for me to see that my problems were
> caused by safe_mode = on.
The @ is added to suppress the *display* of warnings and errors. It is
simply not good to display PHP warnings or error when visitors use the
website.
In safe_mode the additional_parameters parameter is disabled, so it will
not be used at all by the mail() command.
The PHP mail() command is pretty easy, but has a lot of drawbacks. It is
very hard to find the reason why mails are not received, it's virtually
impossible to handle errors in mail sending, etc.
If you upgrade to 4.5.0LTS TYPO3 will use the Swift Mailer library to
send mails. This has better configuration options and can handle the
whole SMTP process internally (thus providing feedback on the results).
The 4.5 core uses Swift Mailer internally and calls to
t3lib_utility_Mail are also passed to the Swift Mailer library.
[1] http://www.php.net/manual/en/features.safe-mode.php
--
Kind regards / met vriendelijke groet,
Jigal van Hemert
skype:jigal.van.hemert
msn: jigal at xs4all.nl
http://twitter.com/jigalvh
More information about the TYPO3-dev
mailing list