Author Topic: E mail attachments mimetype is always "application/octet-stream"  (Read 5154 times)

Offline xkill

  • Newbie
  • *
  • Posts: 2
Hi!
I updated firefox  (v23, ubuntu 10.10) and noticed that all attachements show allways the same mime type, so firefox doesn't show me the option "open with", (I tested with gmail and it works). I've configured the mime types in main.inc.php as following:

$rcmail_config['mime_magic'] = NULL;
$rcmail_config['mime_types'] = '/etc/httpd/mime.types';

Even when I try to preview an attachment from the mail I got errors from roundcube saying that the file is not of the expected type.

Any Help will be appreciated.

Thanks

« Last Edit: August 30, 2013, 03:18:00 AM by xkill »

Offline xkill

  • Newbie
  • *
  • Posts: 2
Re: E mail attachments is always "application/octet-stream"
« Reply #1 on: August 30, 2013, 03:17:12 AM »
Fixed It by editing file /program/steps/mail/get.inc

Edited part now looks like this, starting from line 208

    // send download headers

  if ($plugin['download']) {
      #header("Content-Type: application/octet-stream")
        header("Content-Type: $mimetype");

        if ($browser->ie)
        #header("Content-Type: application/force-download");
        header("Content-Type: $mimetype");
    }
    else if ($ctype_primary == 'text') {
      header("Content-Type: text/$ctype_secondary; charset=" . ($part->charset ? $part->charset : RCMAIL_CHARSET));
    }
    else {
      header("Content-Type: $mimetype");
      header("Content-Transfer-Encoding: binary");
    }
   


I don't know if this is good or bad... but if works as expected and now firefox recognizes the attachment mime types. I didn't tested it on IE because all my machines runs over ltsp enviroment.

Hope this helps somebody