public function listMailbox($reference = '', $mailbox = '*')
    {
        $result = array();
        $list = $this->requestAndResponse('LIST', $this->escapeString($reference, $mailbox));
        if (!$list || $list === true) {
            return $result;
        }

        foreach ($list as $item) {
            if (count($item) != 4 || $item[0] != 'LIST') {
                continue;
            }
            $result[$item[3]] = array('delim' => $item[2], 'flags' => $item[1]);
        }

        return $result;
    }
public function listMailbox($reference = '', $mailbox = '*')
    {
        $result = array();
        $list = $this->requestAndResponse('LIST', $this->escapeString($reference, $mailbox));
        if (!$list || $list === true) {
            return $result;
        }

        foreach ($list as $item) {
            if (count($item) != 4 || $item[0] != 'LIST') {
                continue;
            }
            $result[$item[3]] = array('delim' => $item[2], 'flags' => $item[1]);
        }

        return $result;
    }
public function listMailbox ( $ reference = '' , $ mailbox = '*' ) { $ result = array ( ) ; $ list = $ this -> requestAndResponse ( 'LIST' , $ this -> escapeString ( $ reference , $ mailbox ) ) ; if ( ! $ list || $ list === true ) { return $ result ; } foreach ( $ list as $ item ) { if ( count ( $ item ) != 4 || $ item [ 0 ] != 'LIST' ) { continue ; } $ result [ $ item [ 3 ] ] = array ( 'delim' => $ item [ 2 ] , 'flags' => $ item [ 1 ] ) ; } return $ result ; }
get mailbox list

this method can't be named after the IMAP command 'LIST', as list is a reserved keyword

@param  string $reference mailbox reference for list
@param  string $mailbox   mailbox name match with wildcards
@return array mailboxes that matched $mailbox as array(globalName => array('delim' => .., 'flags' => ..))
@throws Zend_Mail_Protocol_Exception
get mailbox list