try to figure out generic error: IMAP error reported by server on structure retrieval, and failed messageHeaderretrieval

This commit is contained in:
Klaus Leithoff 2014-01-18 13:48:34 +00:00
parent ac0e2f6016
commit c93e4fdc0e
2 changed files with 5 additions and 4 deletions

View File

@ -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);

View File

@ -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);