/**
* get root folder or given folder
*
* @param string $rootFolder get folder structure for given folder, else root
* @return Zend_Mail_Storage_Folder root or wanted folder
* @throws Zend_Mail_Storage_Exception
* @throws Zend_Mail_Protocol_Exception
*/
public function getFolders($rootFolder = null
) { $folders =
$this->_protocol->
listMailbox((string)$rootFolder);
if (!
$folders) { /**
* @see Zend_Mail_Storage_Exception
*/
throw new Zend_Mail_Storage_Exception('folder not found'
);
} ksort($folders, SORT_STRING
);
$root =
new Zend_Mail_Storage_Folder('/', '/', false
);
$stack = array
(null
);
$folderStack = array
(null
);