From 5eb9c70b605cc442c4f49366b6eb765a867b4638 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Wed, 02 Sep 2015 07:49:13 -0400
Subject: [PATCH] Added method to determine IMAP server vendor, for future use

---
 program/lib/Roundcube/rcube_imap_generic.php |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/program/lib/Roundcube/rcube_imap_generic.php b/program/lib/Roundcube/rcube_imap_generic.php
index 47e1ba5..54edad2 100644
--- a/program/lib/Roundcube/rcube_imap_generic.php
+++ b/program/lib/Roundcube/rcube_imap_generic.php
@@ -819,7 +819,7 @@
 
         // Send ID info
         if (!empty($this->prefs['ident']) && $this->getCapability('ID')) {
-            $this->id($this->prefs['ident']);
+            $this->data['ID'] = $this->id($this->prefs['ident']);
         }
 
         $auth_method  = $this->prefs['auth_type'];
@@ -967,6 +967,8 @@
             $this->closeConnection();
             return false;
         }
+
+        $this->data['GREETING'] = trim(preg_replace('/\[[^\]]+\]\s*/', '', $line));
 
         // RFC3501 [7.1] optional CAPABILITY response
         if (preg_match('/\[CAPABILITY ([^]]+)\]/i', $line, $matches)) {
@@ -1621,7 +1623,7 @@
      * @return array Server identification information key/value hash
      * @since 0.6
      */
-    function id($items=array())
+    function id($items = array())
     {
         if (is_array($items) && !empty($items)) {
             foreach ($items as $key => $value) {
@@ -1633,7 +1635,6 @@
         list($code, $response) = $this->execute('ID', array(
             !empty($args) ? '(' . implode(' ', (array) $args) . ')' : $this->escape(null)
         ));
-
 
         if ($code == self::ERROR_OK && preg_match('/\* ID /i', $response)) {
             $response = substr($response, 5); // remove prefix "* ID "

--
Gitblit v1.9.1