diff --git a/mail/inc/class.mail_activesync.inc.php b/mail/inc/class.mail_activesync.inc.php index a994030172..f8cc68def2 100644 --- a/mail/inc/class.mail_activesync.inc.php +++ b/mail/inc/class.mail_activesync.inc.php @@ -1023,7 +1023,7 @@ 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); + $headers = $this->mail->getMessageHeader($id,'',true,true); if (empty($headers)) { error_log(__METHOD__.__LINE__.' Retrieval of Headers Failed! for .'.$this->account.' ServerID:'.self::$profileID.'FolderID:'.$folderid.' ID:'.$id.' TruncSize:'.$truncsize.' Bodypreference: '.array2string($bodypreference).' Stat was:'.array2string($stat)); @@ -1305,7 +1305,7 @@ class mail_activesync implements activesync_plugin_write, activesync_plugin_send // $output->from = $this->messages[$id]['sender_address']; //$stat['FETCHED_HEADER']['sender_name'] //error_log(__METHOD__.__LINE__.' To:'.$headers['TO']); $output->to = $headers['TO']; -//error_log(__METHOD__.__LINE__.' From:'.$headers['FROM'].' Charset:'.$this->mail->detect_encoding($headers['FROM'])); +error_log(__METHOD__.__LINE__.' From:'.$headers['FROM']); $output->from = $headers['FROM']; $output->cc = ($headers['CC'] ? $headers['CC']:null); $output->reply_to = ($headers['REPLY_TO']?$headers['REPLY_TO']:null); diff --git a/mail/inc/class.mail_bo.inc.php b/mail/inc/class.mail_bo.inc.php index 9ad3699518..8381d656dd 100644 --- a/mail/inc/class.mail_bo.inc.php +++ b/mail/inc/class.mail_bo.inc.php @@ -2758,24 +2758,6 @@ class mail_bo $this->icServer->expunge($_folder); break; } - if ($updateCache) - { - $structure = egw_cache::getCache(egw_cache::INSTANCE,'email','structureCache'.trim($GLOBALS['egw_info']['user']['account_id']),$callback=null,$callback_params=array(),$expiration=60*60*1); - $cachemodified = false; - if (is_null($_messageUID)) $_messageUID='all'; - foreach ((array)$_messageUID as $k => $_uid) - { - if (isset($structure[$this->icServer->ImapServerId][$_folder][$_uid]) || $_uid=='all') - { - $cachemodified = true; - if ($_uid=='all') - unset($structure[$this->icServer->ImapServerId][$_folder]); - else - unset($structure[$this->icServer->ImapServerId][$_folder][$_uid]); - } - } - if ($cachemodified) egw_cache::setCache(egw_cache::INSTANCE,'email','structureCache'.trim($GLOBALS['egw_info']['user']['account_id']),$structure,$expiration=60*60*1); - } if($oldMailbox != '') { $this->icServer->openMailbox($oldMailbox); } @@ -3048,23 +3030,6 @@ class mail_bo return false; } } - if ($deleteAfterMove === true) - { - if($deleteOptions != "mark_as_deleted") - { - $structure = egw_cache::getCache(egw_cache::INSTANCE,'email','structureCache'.trim($GLOBALS['egw_info']['user']['account_id']),$callback=null,$callback_params=array(),$expiration=60*60*1); - $cachemodified = false; - foreach ((array)$_messageUID as $k => $_uid) - { - if (isset($structure[$this->icServer->ImapServerId][(!empty($currentFolder)?$currentFolder: $this->sessionData['mailbox'])][$_uid])) - { - $cachemodified = true; - unset($structure[$this->icServer->ImapServerId][(!empty($currentFolder)?$currentFolder: $this->sessionData['mailbox'])][$_uid]); - } - } - if ($cachemodified) egw_cache::setCache(egw_cache::INSTANCE,'email','structureCache'.trim($GLOBALS['egw_info']['user']['account_id']),$structure,$expiration=60*60*1); - } - } //error_log(__METHOD__.__LINE__.array2string($retUid)); return ($returnUIDs ? $retUid : true); @@ -3223,106 +3188,6 @@ class mail_bo * Header and Bodystructure stuff */ - /** - * _getStructure - * fetch the structure of a mail, represented by uid - * @param string/int $_uid the messageuid, - * @param boolean $byUid=true, is the messageuid given by UID or ID - * @param boolean $_ignoreCache=false, use or disregard cache, when fetching - * @param string $_folder='', if given search within that folder for the given $_uid, else use sessionData['mailbox'], or servers getCurrentMailbox - * @return array an structured array of information about the mail - */ - function _getStructure($_uid, $byUid=true, $_ignoreCache=false, $_folder = '') - { - static $structure; - if (empty($_folder)) $_folder = ($this->sessionData['mailbox']? $this->sessionData['mailbox'] : $this->icServer->getCurrentMailbox()); - //error_log(__METHOD__.__LINE__.'User:'.trim($GLOBALS['egw_info']['user']['account_id'])." UID: $_uid, ".$this->icServer->ImapServerId.','.$_folder); - if (is_null($structure)) $structure = egw_cache::getCache(egw_cache::INSTANCE,'email','structureCache'.trim($GLOBALS['egw_info']['user']['account_id']),$callback=null,$callback_params=array(),$expiration=60*60*1); - //error_log(__METHOD__.__LINE__." UID: $_uid, ".$this->icServer->ImapServerId.','.$_folder.'->'.array2string(array_keys($structure))); - if (isset($structure[$this->icServer->ImapServerId]) && !empty($structure[$this->icServer->ImapServerId]) && - isset($structure[$this->icServer->ImapServerId][$_folder]) && !empty($structure[$this->icServer->ImapServerId][$_folder]) && - isset($structure[$this->icServer->ImapServerId][$_folder][$_uid]) && !empty($structure[$this->icServer->ImapServerId][$_folder][$_uid])) - { - if ($_ignoreCache===false) - { - //error_log(__METHOD__.__LINE__.' Using cache for structure on Server:'.$this->icServer->ImapServerId.' for uid:'.$_uid." in Folder:".$_folder.'->'.array2string($structure[$this->icServer->ImapServerId][$_folder][$_uid])); - return $structure[$this->icServer->ImapServerId][$_folder][$_uid]; - } - } - $structure[$this->icServer->ImapServerId][$_folder][$_uid] = $this->icServer->getStructure($_uid, $byUid); - egw_cache::setCache(egw_cache::INSTANCE,'email','structureCache'.trim($GLOBALS['egw_info']['user']['account_id']),$structure,$expiration=60*60*1); - //error_log(__METHOD__.__LINE__.' Using query for structure on Server:'.$this->icServer->ImapServerId.' for uid:'.$_uid." in Folder:".$_folder.'->'.array2string($structure[$this->icServer->ImapServerId][$_folder][$_uid])); - return $structure[$this->icServer->ImapServerId][$_folder][$_uid]; - } - - /** - * _getSubStructure - * fetch the substructure of a mail, by given structure and partid - * @param array $_structure='', if given use structure for parsing - * @param string/int $_partID the partid, - * @return array an structured array of information about the mail - */ - function _getSubStructure($_structure, $_partID) - { - $tempID = ''; - $structure = $_structure; - if (empty($_partID)) $_partID=1; - $imapPartIDs = explode('.',$_partID); - #error_log(print_r($structure,true)); - #error_log(print_r($_partID,true)); - - if($_partID != 1) { - foreach($imapPartIDs as $imapPartID) { - if(!empty($tempID)) { - $tempID .= '.'; - } - $tempID .= $imapPartID; - #error_log(print_r( "TEMPID: $tempID
",true)); - //_debug_array($structure); - if($structure->subParts[$tempID]->type == 'MESSAGE' && $structure->subParts[$tempID]->subType == 'RFC822' && - count($structure->subParts[$tempID]->subParts) == 1 && - $structure->subParts[$tempID]->subParts[$tempID]->type == 'MULTIPART' && - ($structure->subParts[$tempID]->subParts[$tempID]->subType == 'MIXED' || - $structure->subParts[$tempID]->subParts[$tempID]->subType == 'ALTERNATIVE' || - $structure->subParts[$tempID]->subParts[$tempID]->subType == 'RELATED' || - $structure->subParts[$tempID]->subParts[$tempID]->subType == 'REPORT')) - { - $structure = $structure->subParts[$tempID]->subParts[$tempID]; - } else { - $structure = $structure->subParts[$tempID]; - } - } - } - - if($structure->partID != $_partID) { - foreach($imapPartIDs as $imapPartID) { - if(!empty($tempID)) { - $tempID .= '.'; - } - $tempID .= $imapPartID; - //print "TEMPID: $tempID
"; - //_debug_array($structure); - if($structure->subParts[$tempID]->type == 'MESSAGE' && $structure->subParts[$tempID]->subType == 'RFC822' && - count($structure->subParts[$tempID]->subParts) == 1 && - $structure->subParts[$tempID]->subParts[$tempID]->type == 'MULTIPART' && - ($structure->subParts[$tempID]->subParts[$tempID]->subType == 'MIXED' || - $structure->subParts[$tempID]->subParts[$tempID]->subType == 'ALTERNATIVE' || - $structure->subParts[$tempID]->subParts[$tempID]->subType == 'RELATED' || - $structure->subParts[$tempID]->subParts[$tempID]->subType == 'REPORT')) { - $structure = $structure->subParts[$tempID]->subParts[$tempID]; - } else { - $structure = $structure->subParts[$tempID]; - } - } - if($structure->partID != $_partID) { - error_log(__METHOD__."(". __LINE__ .") partID's don't match"); - return false; - } - } - - return $structure; - } - /** * getMimePartCharset - fetches the charset mimepart if it exists * @param $_mimePartObject structure object @@ -4369,11 +4234,11 @@ class mail_bo $uidsToFetch->add((array)$_uid); $fquery = new Horde_Imap_Client_Fetch_Query(); - $fquery->fullText(); + $fquery->fullText(array('peek'=>true)); if ($_partID != '') { $fquery->structure(); - $fquery->bodyPart($_partID); + $fquery->bodyPart($_partID,array('peek'=>true)); } $headersNew = $this->icServer->fetch($_folder, $fquery, array( 'ids' => $uidsToFetch, @@ -4399,11 +4264,11 @@ class mail_bo $uidsToFetch->add((array)$_uid); $fquery = new Horde_Imap_Client_Fetch_Query(); - $fquery->fullText(); + $fquery->fullText(array('peek'=>true));//always do that as peek -> no seen flag set if ($_partID != '') { $fquery->structure(); - $fquery->bodyPart($_partID); + $fquery->bodyPart($_partID,array('peek'=>true)); } $headersNew = $this->icServer->fetch($_folder, $fquery, array( 'ids' => $uidsToFetch, @@ -4484,7 +4349,7 @@ class mail_bo if (!isset($_structure)) { - $_structure = $this->getStructure($_uid, $_partID); + $_structure = $this->getStructure($_uid, $_partID,null,true); } if (!$_structure || !$_structure->contentTypeMap()) return array(); foreach($_structure->contentTypeMap() as $mime_id => $mime_type) diff --git a/mail/templates/default/app.css b/mail/templates/default/app.css index 2c8ebdece1..f19a424f60 100644 --- a/mail/templates/default/app.css +++ b/mail/templates/default/app.css @@ -563,4 +563,4 @@ div.mailPreviewHeaders #mail-index_previewAttachmentArea.visible { } .mail_extraEmails.visible > a { display: list-item; -} \ No newline at end of file +} diff --git a/mail/templates/default/index.xet b/mail/templates/default/index.xet index 7869d13397..4c9d13311c 100644 --- a/mail/templates/default/index.xet +++ b/mail/templates/default/index.xet @@ -79,8 +79,7 @@ - - + @@ -94,7 +93,6 @@ -