From: Michael M Slusarz Date: Wed, 1 Apr 2009 18:28:05 +0000 (-0600) Subject: Transfer IMAP flags from old server. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=00effab0ddb1f57b007f39f1770d868777a37185;p=horde.git Transfer IMAP flags from old server. --- diff --git a/imp/lib/Fetchmail.php b/imp/lib/Fetchmail.php index e51323534..656816fd9 100644 --- a/imp/lib/Fetchmail.php +++ b/imp/lib/Fetchmail.php @@ -262,10 +262,11 @@ abstract class IMP_Fetchmail * * @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); @@ -281,7 +282,7 @@ abstract class IMP_Fetchmail } 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; diff --git a/imp/lib/Fetchmail/imap.php b/imp/lib/Fetchmail/imap.php index 5f13b36c1..424415832 100644 --- a/imp/lib/Fetchmail/imap.php +++ b/imp/lib/Fetchmail/imap.php @@ -195,14 +195,15 @@ class IMP_Fetchmail_imap extends IMP_Fetchmail 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; }