Skip to content

Commit

Permalink
Implement Horde_ActiveSync_Imap_Adapter::emptyMailbox()
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Aug 11, 2014
1 parent d6be1b1 commit 4d6fceb
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions framework/ActiveSync/lib/Horde/ActiveSync/Imap/Adapter.php
Expand Up @@ -139,6 +139,25 @@ public function deleteMailbox($name)
}
}

/**
* Completely empty specified mailbox.
*
* @param string $mbox The mailbox to empty.
*
* @throws Horde_ActiveSync_Exception
* @since 2.18.0
*/
public function emptyMailbox($mbox)
{
$imap = $this->_getImapOb();
$mbox = new Horde_Imap_Client_Mailbox($mbox);
try {
$imap->expunge($mbox, array('delete' => true));
} catch (Horde_Imap_Client_Exception $e) {
throw new Horde_ActiveSync_Exception($e);
}
}

/**
* Permanently delete a mail message.
*
Expand Down

0 comments on commit 4d6fceb

Please sign in to comment.