Need to open mailbox with SELECT for useful PERMFLAGS information.
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 24 Feb 2010 21:28:32 +0000 (14:28 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 24 Feb 2010 21:36:13 +0000 (14:36 -0700)
imp/lib/Imap/Flags.php

index eeedf95..b3981af 100644 (file)
@@ -71,6 +71,9 @@ class IMP_Imap_Flags
          * from the PERMANENTFLAGS IMAP response. */
         if (!empty($options['mailbox'])) {
             try {
+                /* Make sure we are in R/W mailbox mode (SELECT). No flags are
+                 * allowed in EXAMINE mode. */
+                $GLOBALS['imp_imap']->ob()->openMailbox($options['mailbox'], Horde_Imap_Client::OPEN_READWRITE);
                 $status = $GLOBALS['imp_imap']->ob()->status($options['mailbox'], Horde_Imap_Client::STATUS_PERMFLAGS);
                 if (!in_array('\\*', $status['permflags'])) {
                     $avail_flags = array_intersect($avail_flags, $status['permflags']);