*
* @param string $header The message header text.
* @param string $body The message body text.
+ * @param array $flags The IMAP flags to add.
*
* @return boolean True on success, false on failure.
*/
- protected function _addMessage($header, $body)
+ protected function _addMessage($header, $body, $flags)
{
$msg = rtrim($header);
}
try {
- $GLOBALS['imp_imap']->ob->append($this->_params['lmailbox'], array(array('data' => $msg)));
+ $GLOBALS['imp_imap']->ob->append($this->_params['lmailbox'], array(array('data' => $msg, 'flags' => $flags)));
return true;
} catch (Horde_Imap_Client_Exception $e) {
return false;
try {
$res = $this->_ob->fetch($mbox, array(
Horde_Imap_Client::FETCH_HEADERTEXT => array(array('peek' => $peek)),
- Horde_Imap_Client::FETCH_BODYTEXT => array(array('peek' => true))
+ Horde_Imap_Client::FETCH_BODYTEXT => array(array('peek' => true)),
+ Horde_Imap_Client::FETCH_FLAGS => true
), array('ids' => array($id)));
} catch (Horde_Imap_Client_Exception $e) {
continue;
}
/* Append to the server. */
- if ($this->_addMessage($res[$id]['headertext'][0], $res[$id]['bodytext'][0])) {
+ if ($this->_addMessage($res[$id]['headertext'][0], $res[$id]['bodytext'][0], $res[$id]['flags'])) {
++$numMsgs;
$to_store[] = $id;
}