Welcome Guest, Not a member yet? Register   Sign In
Email Timeout
#1
Question 

I've recently happened across a situation with Email Timeouts that appears to have no simple work-around.

Although the Email setup I have generally works well, in certain situations I've found that if the connection to the SMTP server is lost/broken, or, in this particular case, the SMTP server purposefully silently doping the connection (as s a result of the SMTP being subject to excessive attacks by spammers, the owners of the server purposefully leave certain connections hanging))... it causes the CI code to wait pretty much indefinable (in my case long enough to have the (generous) JavaScript timeout on the client side terminate the connection with a "the server's not responding" error message
.
In the Email config, I have:

Code:
public int $SMTPTimeout = 5;
public bool $DSN = true;            // since this SMTP server does advertise DSN

It would appear that $SMTPTimeout only applies to the initial establishment of the connection/stream, but once there has been some handshaking... its job is done and never gets used again.

Is there any reasonable way to be able to have some sort of timeout on the connection's total duration... so that, say once the connection has been established (within $SMTPTimeout), some other timer starts ticking, so that within say $SMTPMaxDuration, if the interaction hasn't been concluded, CI assumes that it's the connection has fallen over/failed... and then returns control/a failure notification?

I have sniffed around in the protected function sendData($data), in system/Email/Email.php, which makes it evident that $result ( ===0 ) is necessary before the code uses $SMTPTimeout... whereas the timeout should likely be applied in the fwrite() function that generates this $result.  A superficial look at PHP like stream_set_timeout() also don't seem to be a quick fix (as it also appears to work on stream establishment and not as an end-stop for the maximum duration.

Any ideas or suggestions would be appreciated, thanks.
Reply


Messages In This Thread
Email Timeout - by Gary - 01-21-2024, 07:31 AM
RE: Email Timeout - by InsiteFX - 01-21-2024, 07:59 AM
RE: Email Timeout - by Gary - 01-21-2024, 09:13 AM
RE: Email Timeout - by InsiteFX - 01-21-2024, 10:27 AM
RE: Email Timeout - by Gary - 01-21-2024, 11:16 AM



Theme © iAndrew 2016 - Forum software by © MyBB