From 0e647e4aa059c48f8b0842977d710de743fcc586 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Fri, 31 Jul 2015 10:04:09 -0400
Subject: [PATCH] Don't use private properties of Net_SMTP object
---
program/lib/Roundcube/rcube_smtp.php | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/program/lib/Roundcube/rcube_smtp.php b/program/lib/Roundcube/rcube_smtp.php
index 5a30ab4..53298e6 100644
--- a/program/lib/Roundcube/rcube_smtp.php
+++ b/program/lib/Roundcube/rcube_smtp.php
@@ -127,9 +127,12 @@
$result = $this->conn->connect($CONFIG['smtp_timeout']);
if (is_a($result, 'PEAR_Error')) {
- $this->response[] = "Connection failed: ".$result->getMessage();
- $this->error = array('label' => 'smtpconnerror', 'vars' => array('code' => $this->conn->_code));
+ $this->response[] = "Connection failed: " . $result->getMessage();
+
+ list($code,) = $this->conn->getResponse();
+ $this->error = array('label' => 'smtpconnerror', 'vars' => array('code' => $code));
$this->conn = null;
+
return false;
}
@@ -160,10 +163,14 @@
$result = $this->conn->auth($smtp_user, $smtp_pass, $smtp_auth_type, $use_tls, $smtp_authz);
if (is_a($result, 'PEAR_Error')) {
- $this->error = array('label' => 'smtpautherror', 'vars' => array('code' => $this->conn->_code));
- $this->response[] .= 'Authentication failure: ' . $result->getMessage() . ' (Code: ' . $result->getCode() . ')';
+ list($code,) = $this->conn->getResponse();
+ $this->error = array('label' => 'smtpautherror', 'vars' => array('code' => $code));
+ $this->response[] = 'Authentication failure: ' . $result->getMessage()
+ . ' (Code: ' . $result->getCode() . ')';
+
$this->reset();
$this->disconnect();
+
return false;
}
}
--
Gitblit v1.9.1