alecpl
2009-10-12 4f69328132beae439d1aecb6d35d55392e480eca
program/include/rcube_imap.php
@@ -602,7 +602,8 @@
    if ($this->index_sort && $this->sort_field == 'date')
      {
        if ($this->skip_deleted) {
          $msg_index = $this->_search_index($mailbox, 'ALL');
          // @TODO: this could be cached
     $msg_index = $this->_search_index($mailbox, 'ALL UNDELETED');
          $max = max($msg_index);
          list($begin, $end) = $this->_get_message_range(count($msg_index), $page);
          $msg_index = array_slice($msg_index, $begin, $end-$begin);
@@ -1225,17 +1226,15 @@
      else
        $this->struct_charset = $this->_structure_charset($structure);
      /*
        @TODO: here we can recognize malformed BODYSTRUCTURE and parse
   the message in other way to create our own message structure.
   Example of structure for malformed MIME message:
   ("text" "plain" ("charset" "us-ascii") NIL NIL "7bit" 2154 70 NIL NIL NIL)
   if ($headers->ctype != 'text/plain'
     && !is_array($structure[0]) && $structure[0] == 'text'
     && !is_array($structure[1]) && $structure[1] == 'plain')
     { }
      */
      // Here we can recognize malformed BODYSTRUCTURE and
      // 1. [@TODO] parse the message in other way to create our own message structure
      // 2. or just show the raw message body.
      // Example of structure for malformed MIME message:
      // ("text" "plain" ("charset" "us-ascii") NIL NIL "7bit" 2154 70 NIL NIL NIL)
      if ($headers->ctype && $headers->ctype != 'text/plain'
     && $structure[0] == 'text' && $structure[1] == 'plain') {
   return false;
   }
      $struct = &$this->_structure_part($structure);
      $struct->headers = get_object_vars($headers);