FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » Log error when mail() returns FALSE
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Log error when mail() returns FALSE [message #29906] Mon, 23 January 2006 20:42 Go to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Please consider logging an error when the forum is unable to send mail. Currently, mail() failures are ignored.
Re: Log error when mail() returns FALSE [message #29919 is a reply to message #29906] Tue, 24 January 2006 18:34 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Return status of the mail() function in unreliable in many situation, testing the return status will lead to many false positives.

FUDforum Core Developer
Re: Log error when mail() returns FALSE [message #29930 is a reply to message #29919] Tue, 24 January 2006 19:28 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Yes, one may get false positives, however you will never get false negatives. So, it should be OK to report them.

It took me more than 24 hours to realize my forum wasn't sending messages anymore. Reporting it would have helped me to fix the problem sooner.
Re: Log error when mail() returns FALSE [message #29932 is a reply to message #29930] Tue, 24 January 2006 19:32 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
On many PHP installs you will ALWAYS get negative responses, making logging of these errors utterly pointless. There are atleast 2 reasons in PHP why mail() may return FALSE but send the e-mail in reality.

FUDforum Core Developer
Re: Log error when mail() returns FALSE [message #29936 is a reply to message #29932] Tue, 24 January 2006 19:36 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
OK, point taken.

It will teach me to properly test the forum after making such changes.
icon4.gif  Re: Log error when mail() returns FALSE [message #35317 is a reply to message #29932] Thu, 28 December 2006 11:30 Go to previous messageGo to next message
viumido is currently offline  viumido   India
Messages: 1
Registered: December 2006
Location: USA
Karma: 0
Junior Member
You touched on a problem I am having with PHP Mail(), that is it always returns "False" even though the mail is sending fine. Can you elaborate on this and what I can do about it? I'd really like to confirm at least that it 'may' be sending. What are the two reasons you hinted at? What is a common work-around?

Also, I tried to use the html mime version in the header, just want to use <b> tags on some of my text, and somewhere along the way it still arrives as plain text! Any ideas?? I've waisted TWO days on these two miserable issues.



Viumido
Re: Log error when mail() returns FALSE [message #35320 is a reply to message #35317] Thu, 28 December 2006 14:55 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
This is the case when PHP is compiled with --enable-sigchild flag. This flag activates the code that makes it impossible to determine the returned value of spawned binary. Subsequently mail() which internally spawns sendmail binary claims to fail even though it works.

FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Double Emails
Next Topic: Private messages
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 30 16:40:48 GMT 2024

Total time taken to generate the page: 0.02377 seconds