public function getUidFromMidInFolders($id, array $folders)
{
$search_q = new Horde_Imap_Client_Search_Query();
$search_q->headerText('Message-ID', $id);
foreach ($folders as $folder) {
$mbox = new Horde_Imap_Client_Mailbox($folder->_serverid);
try {
$results = $this->_getImapOb()->search($mbox, $search_q);
} catch (Horde_Imap_Client_Exception $e) {
throw new Horde_ActiveSync_Exception($e->getMessage());
}
$uid = $results['match']->ids;
if (!empty($uid)) {
return array($mbox, current($uid));
}
}
throw new Horde_Exception_NotFound('Message not found.');
}