summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-07-02 14:49:48 +0200
committerAleksander Machniak <alec@alec.pl>2013-07-02 14:49:48 +0200
commited3e51f1b41d818ae757220fd41cdf0b093b20f6 (patch)
treead825a50d48aaa86a1df10b5ec3b3e593d581a4c
parent446dbedbf606c61f06846d04f75e03dfbc3fedfd (diff)
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.
-rw-r--r--CHANGELOG1
-rw-r--r--INSTALL11
-rw-r--r--config/main.inc.php.dist8
-rw-r--r--program/lib/Roundcube/rcube.php1
-rw-r--r--program/lib/Roundcube/rcube_imap_generic.php8
5 files changed, 27 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 14dc4c74e..d1e8ff757 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================
+- Make possible to disable some (broken) IMAP extensions with imap_disable_caps option (#1489184)
- Contacts drag-n-drop default action is to move contacts (#1488751)
- Added possibility to choose to move or copy contacts from drag-n-drop menu (#1488751)
- Fix messages list sorting with THREAD=REFS
diff --git a/INSTALL b/INSTALL
index 3876f632c..a4e8aa3e8 100644
--- a/INSTALL
+++ b/INSTALL
@@ -52,7 +52,8 @@ INSTALLATION
4. Point your browser to http://url-to-roundcube/installer/
5. Follow the instructions of the install script (or see MANUAL CONFIGURATION)
6. After creating and testing the configuration, remove the installer directory
-7. Done!
+7. Check Known Issues section of this file
+8. Done!
CONFIGURATION HINTS
@@ -137,7 +138,6 @@ bin/cleandb.sh which finally removes all records that are marked as deleted.
Best solution is to install a cronjob running this script daily.
-
MANUAL CONFIGURATION
====================
@@ -233,3 +233,10 @@ $HTTP["host"] == "www.example.com" {
compress.filetype = ("text/plain", "text/html", "text/javascript", "text/css", "text/xml", "image/gif", "image/png")
}
+
+
+KNOWN ISSUES
+============
+
+Installations with uw-imap server should set imap_disabled_caps = array('ESEARCH')
+in main configuration file. ESEARCH implementation in this server is broken (#1489184).
diff --git a/config/main.inc.php.dist b/config/main.inc.php.dist
index f24f51ff3..1d1eb9d6e 100644
--- a/config/main.inc.php.dist
+++ b/config/main.inc.php.dist
@@ -107,12 +107,20 @@ $rcmail_config['imap_force_caps'] = false;
// extension if available. Some servers (dovecot 1.x) returns wrong results
// for shared namespaces in this case. http://trac.roundcube.net/ticket/1486225
// Enable this option to force LSUB command usage instead.
+// Deprecated: Use imap_disabled_caps = array('LIST-EXTENDED')
$rcmail_config['imap_force_lsub'] = false;
// Some server configurations (e.g. Courier) doesn't list folders in all namespaces
// Enable this option to force listing of folders in all namespaces
$rcmail_config['imap_force_ns'] = false;
+// List of disabled imap extensions.
+// Use if your IMAP server has broken implementation of some feature
+// and you can't remove it from CAPABILITY string on server-side.
+// For example UW-IMAP server has broken ESEARCH.
+// Note: Because the list is cached, re-login is required after change.
+$rcmail_config['imap_disabled_caps'] = array();
+
// IMAP connection timeout, in seconds. Default: 0 (no limit)
$rcmail_config['imap_timeout'] = 0;
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;
}