--- program/lib/Roundcube/rcube_smtp.php.orig +++ program/lib/Roundcube/rcube_smtp.php @@ -114,8 +114,20 @@ $this->conn->setDebug(true, array($this, 'debug_handler')); $this->anonymize_log = 0; } + // plugin hook to add SASL mechanisms + $result = $rcube->plugins->exec_hook('smtp_add_auth', array( + 'conn' => $this->conn, + )); + + if (is_a($result, 'PEAR_Error')) { + $this->response[] = "Authentication setup failed: ".$result->getMessage(); + $this->error = array('label' => 'smtpconnerror', 'vars' => array('code' => $this->conn->_code)); + $this->conn = null; + return false; + } + // register authentication methods if (!empty($CONFIG['smtp_auth_callbacks']) && method_exists($this->conn, 'setAuthMethod')) { foreach ($CONFIG['smtp_auth_callbacks'] as $callback) { $this->conn->setAuthMethod($callback['name'], $callback['function'],