protected function _deleteMailbox(Horde_Imap_Client_Mailbox $mailbox)
{
// Some IMAP servers will not allow a delete of a currently open
// mailbox.
if ($mailbox->equals($this->_selected)) {
$this->close();
}
$cmd = $this->_command('DELETE')->add($this->_getMboxFormatOb($mailbox));
try {
// DELETE returns no untagged information (RFC 3501 [6.3.4])
$this->_sendCmd($cmd);
} catch (Horde_Imap_Client_Exception $e) {
// Some IMAP servers won't allow a mailbox delete unless all
// messages in that mailbox are deleted.
$this->expunge($mailbox, array('delete' => true));
$this->_sendCmd($cmd);
}
}