php-imap
php-imap copied to clipboard
Better connection check for IMAP
Normally the Protocol class only checks if the stream has been created:
return (bool)$this->stream;
But sometimes (we have many clients and transactions) the PHP stream is TRUE even though the connection has been lost. We have tested to send the simple command "NOOP" to check if the connection is really up and have a lot less "empty response" errors in our logs. I have not found a better way to do this.