From ed3e51f1b41d818ae757220fd41cdf0b093b20f6 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Tue, 2 Jul 2013 14:49:48 +0200 Subject: 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.php | 1 + program/lib/Roundcube/rcube_imap_generic.php | 8 ++++++++ 2 files changed, 9 insertions(+) (limited to 'program/lib/Roundcube') diff --git a/program/lib/Roundcube/rcube.php b/program/lib/Roundcube/rcube.php index 6543a399c..05a94f3be 100644 --- a/program/lib/Roundcube/rcube.php +++ b/program/lib/Roundcube/rcube.php @@ -377,6 +377,7 @@ class rcube 'auth_pw' => $this->config->get("{$driver}_auth_pw"), 'debug' => (bool) $this->config->get("{$driver}_debug"), 'force_caps' => (bool) $this->config->get("{$driver}_force_caps"), + 'disabled_caps' => $this->config->get("{$driver}_disabled_caps"), 'timeout' => (int) $this->config->get("{$driver}_timeout"), 'skip_deleted' => (bool) $this->config->get('skip_deleted'), 'driver' => $driver, diff --git a/program/lib/Roundcube/rcube_imap_generic.php b/program/lib/Roundcube/rcube_imap_generic.php index 1928c7094..ae390a0ee 100644 --- a/program/lib/Roundcube/rcube_imap_generic.php +++ b/program/lib/Roundcube/rcube_imap_generic.php @@ -715,6 +715,10 @@ class rcube_imap_generic $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 @@ class rcube_imap_generic $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; } -- cgit v1.2.3