From ed3e51f1b41d818ae757220fd41cdf0b093b20f6 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Tue, 02 Jul 2013 08:49:48 -0400
Subject: [PATCH] Make possible to disable some (broken) IMAP extensions with imap_disable_caps option (#1489184) Add some notes in INSTALL about broken ESEARCH in uw-imap.

---
 program/lib/Roundcube/rcube_imap_generic.php |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/program/lib/Roundcube/rcube_imap_generic.php b/program/lib/Roundcube/rcube_imap_generic.php
index 1928c70..ae390a0 100644
--- a/program/lib/Roundcube/rcube_imap_generic.php
+++ b/program/lib/Roundcube/rcube_imap_generic.php
@@ -715,6 +715,10 @@
             $auth_method = 'CHECK';
         }
 
+        if (!empty($this->prefs['disabled_caps'])) {
+            $this->prefs['disabled_caps'] = array_map('strtoupper', (array)$this->prefs['disabled_caps']);
+        }
+
         $result = false;
 
         // initialize connection
@@ -3686,6 +3690,10 @@
 
         $this->capability = explode(' ', strtoupper($str));
 
+        if (!empty($this->prefs['disabled_caps'])) {
+            $this->capability = array_diff($this->capability, $this->prefs['disabled_caps']);
+        }
+
         if (!isset($this->prefs['literal+']) && in_array('LITERAL+', $this->capability)) {
             $this->prefs['literal+'] = true;
         }

--
Gitblit v1.9.1