From 67229a86df38c9c2ef94f6506b43150a2e510efd Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Tue, 18 Aug 2015 07:53:30 -0400
Subject: [PATCH] Don't use private properties of Net_SMTP object

---
 program/lib/Roundcube/rcube_smtp.php |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/program/lib/Roundcube/rcube_smtp.php b/program/lib/Roundcube/rcube_smtp.php
index b37b444..9f0c2bb 100644
--- a/program/lib/Roundcube/rcube_smtp.php
+++ b/program/lib/Roundcube/rcube_smtp.php
@@ -127,9 +127,10 @@
         $result = $this->conn->connect($CONFIG['smtp_timeout']);
 
         if (PEAR::isError($result)) {
-            $this->response[] = "Connection failed: ".$result->getMessage();
-            $this->error = array('label' => 'smtpconnerror', 'vars' => array('code' => $this->conn->_code));
+            list($code,) = $this->conn->getResponse();
+            $this->error = array('label' => 'smtpconnerror', 'vars' => array('code' => $code));
             $this->conn  = null;
+
             return false;
         }
 
@@ -160,10 +161,14 @@
             $result = $this->conn->auth($smtp_user, $smtp_pass, $smtp_auth_type, $use_tls, $smtp_authz);
 
             if (PEAR::isError($result)) {
-                $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