protected function _getMailMessages(Horde_Imap_Client_Mailbox $mbox, array $uids, array $options = array())
{
$options = array_merge(array('headers' => false, 'structure' => true, 'flags' => true, 'envelope' => false), $options);
$query = new Horde_Imap_Client_Fetch_Query();
if ($options['structure']) {
$query->structure();
}
if ($options['flags']) {
$query->flags();
}
if ($options['envelope']) {
$query->envelope();
}
if (!empty($options['headers'])) {
$query->headerText(array('peek' => true));
}
try {
return $this->_getImapOb()->fetch($mbox, $query, array('ids' => new Horde_Imap_Client_Ids($uids), 'exists' => true));
} catch (Horde_Imap_Client_Exception $e) {
$this->_logger->err(sprintf('[%s] Unable to fetch message: %s', $this->_procid, $e->getMessage()));
throw new Horde_ActiveSync_Exception($e);
}
}