From c93e4fdc0ea6e9f446d3c43edaec7f2fa8c2792b Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Sat, 18 Jan 2014 13:48:34 +0000 Subject: [PATCH] try to figure out generic error: IMAP error reported by server on structure retrieval, and failed messageHeaderretrieval --- mail/inc/class.mail_activesync.inc.php | 5 +++-- mail/inc/class.mail_bo.inc.php | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mail/inc/class.mail_activesync.inc.php b/mail/inc/class.mail_activesync.inc.php index 1de226261c..596e19b2c7 100644 --- a/mail/inc/class.mail_activesync.inc.php +++ b/mail/inc/class.mail_activesync.inc.php @@ -1016,6 +1016,7 @@ class mail_activesync implements activesync_plugin_write, activesync_plugin_send //$this->debugLevel=4; if (!isset($this->mail)) $this->mail = mail_bo::getInstance(false,self::$profileID); debugLog(__METHOD__.__LINE__.' FolderID:'.$folderid.' ID:'.$id.' TruncSize:'.$truncsize.' Bodypreference: '.array2string($bodypreference)); + $rv = $this->splitID($folderid,$account,$_folderName,$id); $stat = $this->StatMessage($folderid, $id); if ($this->debugLevel>3) debugLog(__METHOD__.__LINE__.array2string($stat)); // StatMessage should reopen the folder in question, so we dont need folderids in the following statements. @@ -1024,10 +1025,10 @@ class mail_activesync implements activesync_plugin_write, activesync_plugin_send debugLog(__METHOD__.__LINE__." Message $id with stat ".array2string($stat)); // initialize the object $output = new SyncMail(); - $headers = $this->mail->getMessageHeader($id,'',true,true); + $headers = $this->mail->getMessageHeader($id,'',true,true,$_folderName); if (empty($headers)) { - error_log(__METHOD__.__LINE__.' Retrieval of Headers Failed! for .'.$this->account.'/'.$GLOBALS['egw_info']['user']['account_lid'].' ServerID:'.self::$profileID.'FolderID:'.$folderid.' ID:'.$id.' TruncSize:'.$truncsize.' Bodypreference: '.array2string($bodypreference).' Stat was:'.array2string($stat)); + error_log(__METHOD__.__LINE__.' Retrieval of Headers Failed! for .'.$this->account.'/'.$GLOBALS['egw_info']['user']['account_lid'].' ServerID:'.self::$profileID.'FolderID:'.$folderid.'/'.$_folderName.' ID:'.$id.' TruncSize:'.$truncsize.' Bodypreference: '.array2string($bodypreference).' Stat was:'.array2string($stat)); return $output;//empty object } //$rawHeaders = $this->mail->getMessageRawHeader($id); diff --git a/mail/inc/class.mail_bo.inc.php b/mail/inc/class.mail_bo.inc.php index b7ba481322..d58d82e03c 100644 --- a/mail/inc/class.mail_bo.inc.php +++ b/mail/inc/class.mail_bo.inc.php @@ -4085,9 +4085,9 @@ class mail_bo * @param boolean $preserveUnSeen flag to preserve the seen flag where applicable * @return array the message header */ - function getMessageHeader($_uid, $_partID = '',$decode=false, $preserveUnSeen=false) + function getMessageHeader($_uid, $_partID = '',$decode=false, $preserveUnSeen=false, $_folder='') { - $_folder = ($this->sessionData['mailbox']? $this->sessionData['mailbox'] : $this->icServer->getCurrentMailbox()); + if (empty($_folder)) $_folder = ($this->sessionData['mailbox']? $this->sessionData['mailbox'] : $this->icServer->getCurrentMailbox()); $uidsToFetch = new Horde_Imap_Client_Ids(); $uidsToFetch->add((array)$_uid);