Add ability to disable server capabilities.
authorMichael M Slusarz <slusarz@curecanti.org>
Mon, 1 Feb 2010 05:55:40 +0000 (22:55 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 1 Feb 2010 05:55:40 +0000 (22:55 -0700)
framework/Imap_Client/lib/Horde/Imap/Client.php
framework/Imap_Client/lib/Horde/Imap/Client/Base.php
framework/Imap_Client/package.xml
imp/config/servers.php.dist
imp/lib/Imap.php

index ad3cd90..968b385 100644 (file)
@@ -31,6 +31,9 @@
  *                + Horde_Imap_Client::FETCH_STRUCTURE
  *   lifetime - [OPTIONAL] (integer) The lifetime of the cache data (in secs).
  *   slicesize - [OPTIONAL] (integer) The slicesize to use.
+ * capability_ignore - (array) A list of IMAP capabilites to ignore, even if
+ *                     they are supported on the server.
+ *                     DEFAULT: No supported capabilities are ignored
  * comparator - (string) The search comparator to use instead of the default
  *              IMAP server comparator. See
  *              Horde_Imap_Client_Base::setComparator() for the format.
index 5e566f0..1561032 100644 (file)
@@ -290,6 +290,10 @@ abstract class Horde_Imap_Client_Base
     {
         if (!isset($this->_init['capability'])) {
             $this->_init['capability'] = $this->_capability();
+
+            if (!empty($this->_params['capability_ignore'])) {
+                $this->_init['capability'] = array_diff_key($this->_init['capability'], array_flip($this->_params['capability_ignore']));
+            }
         }
 
         return $this->_init['capability'];
index e45d3ec..b7d5b75 100644 (file)
@@ -31,7 +31,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
   <api>alpha</api>
  </stability>
  <license uri="http://www.gnu.org/copyleft/lesser.html">LGPL</license>
- <notes>* Add Horde_Imap_Client_Base::parseCacheId().
+ <notes>* Add ability to disable server capabilities.
+ * Add Horde_Imap_Client_Base::parseCacheId().
  * Added STATUS_LASTMODSEQ and STATUS_LASTMODSEQUIDS status() entries.
  * Add support for LIST-STATUS (draft-ietf-morg-status-in-list-01).
  * Add support for THREAD=REFS (draft-ietf-morg-inthread-00).
index d0ffbac..a764049 100644 (file)
  * *** you are doing! FOR MOST PEOPLE, AUTO-DETECTION OF THESE PARAMETERS  ***
  * *** (the default if the parameters are not set) SHOULD BE USED!         ***
  *
+ * capability_ignore: (array) A list of IMAP capabilites to ignore, even if
+ *                    they are supported on the server. This capability names
+ *                    should be in all capitals. This option may be useful,
+ *                    for example, if it is known that a certain capability is
+ *                    buggy on the given server.  Otherwise, all available
+ *                    and supported IMAP capabilities will be (and should be)
+ *                    used. (IMAP only)
+ *
  * comparator: (string) The search comparator to use instead of the default
  *             IMAP server comparator. See RFC 4790 [3.1] - "collation-id" -
  *             for the format. Your IMAP server must support the I18NLEVEL
index 516afcd..5fc3658 100644 (file)
@@ -181,6 +181,7 @@ class IMP_Imap
             : 'imap';
 
         $imap_config = array(
+            'capability_ignore' => empty($server['capability_ignore']) ? array() : $server['capability_ignore'],
             'comparator' => empty($server['comparator']) ? false : $server['comparator'],
             'debug' => isset($server['debug']) ? $server['debug'] : null,
             'hostspec' => isset($server['hostspec']) ? $server['hostspec'] : null,