/**
  * @param string $messageIndex
  * @param bool $indexAsUid
  * @param Folder $folder
  * @return WebMailMessage
  */
 function GetMessageHeader($messageIndex, $indexAsUid, &$folder)
 {
     if ($folder->SyncType == FOLDERSYNC_DirectMode) {
         if ($this->MailStorage->Connect()) {
             $GLOBALS[MailDefaultCharset] = $this->_account->GetDefaultIncCharset();
             $GLOBALS[MailOutputCharset] = $this->_account->GetUserCharset();
             @ini_set('memory_limit', MEMORYLIMIT);
             @set_time_limit(TIMELIMIT);
             return $this->MailStorage->LoadMessageHeader($messageIndex, $indexAsUid, $folder);
         }
     }
     return $this->DbStorage->LoadMessageHeader($messageIndex, $indexAsUid, $folder);
 }