}
/**
- * Return envelope information for the given list of indices.
- *
- * @param string $mailbox The name of the mailbox (UTF7-IMAP).
- * @param array $indices The list of UIDs.
- *
- * @return array The envelope information. See
- * Horde_Imap_Client_Base::fetch() for the format.
- * @throws Horde_Imap_Client_Exception
- */
- public function msgEnvelope($mailbox, $indices)
- {
- return $GLOBALS['imp_imap']->ob()->fetch($mailbox, array(Horde_Imap_Client::FETCH_ENVELOPE => true), array('ids' => $indices));
- }
-
- /**
* Perform a search query on the remote IMAP server.
*
* @param string $mailbox The name of the source
}
/**
- * Returns the cache ID value for a mailbox
- *
- * @param string $mailbox The name of the source mailbox (UTF7-IMAP).
- *
- * @return string The cache ID string.
- * @throws Horde_Imap_Client_Exception
- */
- public function mailboxCacheId($mailbox)
- {
- return $GLOBALS['imp_imap']->ob()->getCacheId($mailbox);
- }
-
- /**
* Returns information on the currently logged on IMAP server.
*
* @return mixed An array with the following entries:
return $sentmail->favouriteRecipients($limit, $filter);
}
+ /**
+ * Returns the Horde_Imap_Client object created using the IMP credentials.
+ *
+ * @return Horde_Imap_Client_Base The imap object.
+ */
+ public function imapOb($mailbox, $indices)
+ {
+ return $GLOBALS['imp_imap']->ob();
+ }
+
}
*/
public function fetchEnvelope($indices)
{
- return $GLOBALS['registry']->hasMethod('mail/msgEnvelope')
- ? $GLOBALS['registry']->call('mail/msgEnvelope', array($this->_params['mailbox'], $indices))
- : false;
+ if ($GLOBALS['registry']->hasMethod('mail/imapOb')) {
+ $ob = $GLOBALS['registry']->call('mail/imapOb');
+ try {
+ return $ob->fetch($this->_params['mailbox'], array(Horde_Imap_Client::FETCH_ENVELOPE => true), array('ids' => $indices));
+ } catch (Horde_Imap_Client_Exception $e) {}
+ }
+
+ return false;
}
/**
*/
protected function _cacheId()
{
- return $GLOBALS['registry']->hasMethod('mail/mailboxCacheId')
- ? $GLOBALS['registry']->call('mail/mailboxCacheId', array($this->_params['mailbox']))
- : time();
+ if ($GLOBALS['registry']->hasMethod('mail/imapOb')) {
+ $ob = $GLOBALS['registry']->call('mail/imapOb');
+ try {
+ return $ob->getCacheId($this->_params['mailbox']);
+ } catch (Horde_Imap_Client_Exception $e) {}
+ }
+
+ return time();
}
}