Special-use fixes.
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 20 Aug 2010 23:04:14 +0000 (17:04 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 20 Aug 2010 23:04:14 +0000 (17:04 -0600)
This is a RETURN option, not a SELECT option.
Some servers complain if they don't know what SPECIAL-USE return is.
Although this seems to go against the draft RFC, use the create
CAPABILITY string to determine whether to send the return option.

framework/Imap_Client/lib/Horde/Imap/Client/Socket.php

index 03fc67a..2a2bc38 100644 (file)
@@ -1097,10 +1097,6 @@ class Horde_Imap_Client_Socket extends Horde_Imap_Client_Base
                 $select_opts[] = 'RECURSIVEMATCH';
             }
 
-            if (!empty($options['special_use'])) {
-                $select_opts[] = 'SPECIAL-USE';
-            }
-
             if (!empty($select_opts)) {
                 $cmd[] = $select_opts;
             }
@@ -1120,6 +1116,11 @@ class Horde_Imap_Client_Socket extends Horde_Imap_Client_Base
                 $return_opts[] = 'CHILDREN';
             }
 
+            if (!empty($options['special_use']) &&
+                $this->queryCapability('CREATE-SPECIAL-USE')) {
+                $return_opts[] = 'SPECIAL-USE';
+            }
+
             if (!empty($options['status']) &&
                 $this->queryCapability('LIST-STATUS')) {
                 $status_mask = array(