alecpl
2012-04-13 0c259682f65eaaf23ea4ccb56a706d6baf3007e4
program/steps/mail/func.inc
@@ -99,6 +99,8 @@
  $OUTPUT->set_env('threads', $threading || $RCMAIL->storage->get_capability('THREAD'));
  $OUTPUT->set_env('preview_pane_mark_read', $RCMAIL->config->get('preview_pane_mark_read', 0));
  if ($CONFIG['delete_junk'])
    $OUTPUT->set_env('delete_junk', true);
  if ($CONFIG['flag_for_deletion'])
    $OUTPUT->set_env('flag_for_deletion', true);
  if ($CONFIG['read_when_deleted'])
@@ -228,7 +230,7 @@
  // Make sure there are no duplicated columns (#1486999)
  $a_show_cols = array_unique($a_show_cols);
  // Plugins may set header's list_cols/list_flags and other rcube_mail_header variables
  // Plugins may set header's list_cols/list_flags and other rcube_message_header variables
  // and list columns
  $plugin = $RCMAIL->plugins->exec_hook('messages_list',
    array('messages' => $a_headers, 'cols' => $a_show_cols));
@@ -1022,10 +1024,20 @@
    foreach ($MESSAGE->parts as $i => $part) {
      if ($part->type == 'headers')
        $out .= rcmail_message_headers(sizeof($header_attrib) ? $header_attrib : NULL, $part->headers);
      else if ($part->type == 'content' && $part->size) {
      else if ($part->type == 'content') {
        // unsapported
        if ($part->realtype) {
          if ($part->realtype == 'multipart/encrypted') {
            $out .= html::span('part-notice', rcube_label('encryptedmessage'));
          }
          continue;
        }
        else if (!$part->size) {
          continue;
        }
        // Check if we have enough memory to handle the message in it
        // #1487424: we need up to 10x more memory than the body
        if (!rcmail_mem_check($part->size * 10)) {
        else if (!rcmail_mem_check($part->size * 10)) {
          $out .= html::span('part-notice', rcube_label('messagetoobig'). ' '
            . html::a('?_task=mail&_action=get&_download=1&_uid='.$MESSAGE->uid.'&_part='.$part->mime_id
              .'&_mbox='. urlencode($RCMAIL->storage->get_folder()), rcube_label('download')));
@@ -1436,9 +1448,14 @@
  $part = $MESSAGE->mime_parts[$part];
  $table = new html_table(array('cols' => 3));
  if (!empty($part->filename)) {
  $filename = $part->filename;
  if (empty($filename) && $attach_prop->mimetype == 'text/html') {
    $filename = rcube_label('htmlmessage');
  }
  if (!empty($filename)) {
    $table->add('title', Q(rcube_label('filename')));
    $table->add('header', Q($part->filename));
    $table->add('header', Q($filename));
    $table->add('download-link', html::a(array('href' => './?'.str_replace('_frame=', '_download=', $_SERVER['QUERY_STRING'])), Q(rcube_label('download'))));
  }