Forum

WaitForCGI=no causes php mail function to return false

Jefferson
31 May 2013, 08:49
Hi,

I was configuring hiawatha to not kill fileuploads sent thru post to php scripts as file downloads sent thru php scripts to clients. Since I wasn't sure which was the best way and WaitForCGI description on the manual page isn't very clear I set it to no.

Later I discovered that mail function was returning false, even using phpmailer and using sendmail was returning false for popen, but messages were being sent. Setting WaitForCGI back to yes fixed the issue, I'm not sure what is the real usage of waitforcgi and what is the expected behaviour, but this was pretty awkward and stressfull when you dont have an idea what is causing an issue and spend a lot of ours troubleshooting until you find the solution. So just in case I'm sharing this experience here not been sure if it is a bug.

Hiawatha version: 9.1
Operating System: Debian Squeeze
PHP: 5.3.x
Jefferson
31 May 2013, 08:57
Forgot to say that this is when using the cgi-wrapper, with a fast cgi server this does not happens
Hugo Leisink
31 May 2013, 09:10
A CGI runs via a separate process. Via WaitForCGI, you can tell Hiawatha to wait for the CGI process to finish its job after is has recieved the last byte of its output or not.
Jefferson
31 May 2013, 09:55
I wonder why mail() was returning false (even when then message is being sent) with WaitForCGI=no
Hugo Leisink
31 May 2013, 10:01
I have no idea...
Jefferson
31 May 2013, 10:18
if it servers for something here is a sample of the problematic configuration: http://pastebin.com/3ycrwVVp
This topic has been closed.