From 00effab0ddb1f57b007f39f1770d868777a37185 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Wed, 1 Apr 2009 12:28:05 -0600 Subject: [PATCH] Transfer IMAP flags from old server. --- imp/lib/Fetchmail.php | 5 +++-- imp/lib/Fetchmail/imap.php | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) 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; } -- 2.11.0