On Thu, 2006-03-02 at 16:18 -0500, John Dennis wrote:
I noticed a lot of the smtp functions don't check for errors. Also it would be nice if when an error is encountered it was logged to a file. log_bug() in bugs.inc seems like the right logging function to call when errors are detected, right? I'm happy to make some patches if you're willing to take them.
Silly me! I see that raise_error seems to do what is desired, but for some reason in rcube_smtp when there is an error the error message from the subsystem is discarded in favor of a generic message (appended to SMTP_ERROR) such as "Connection failed", which is eventually raised as an error in sendmail.inc. Shouldn't the error handling code in rcube_smtp be doing something like this instead?
// try to connect to server and exit on failure
if (PEAR::isError($result= $SMTP_CONN->connect($smtp_timeout)))
{
$SMTP_CONN = null;
$SMTP_ERROR .= "Connection failed\n" . $result->getMessage();
return FALSE;
}