Ticket #1485152 (closed Bugs: fixed)

Opened 3 months ago

Last modified 4 weeks ago

problems with MIME detection of attachements MS Word and Excel

Reported by: tomeek Owned by:
Priority: 5 Milestone: 0.2-beta
Component: PHP backend Version: 0.1.1
Severity: normal Keywords:
Cc:

Description (last modified by thomasb) (diff)

Hello all,

I have discovered that this ticket was already here. But was closed as it was working. But, this check was incorrect.

I'm using stable version 1.1 of roundcube mail and users are complaining that MS Excel attachements are badly detected like a MS World.

See this email source:

MIME-Version: 1.0
Date: Mon, 23 Jun 2008 15:07:42 +0200
From: Tomas Vobruba <blabla@bla.com>
To: test@bla.com
Subject: ttt
Reply-To: test@blabla.com
Message-ID: <f46f5ba5537c28fc5913b406d4e70809@bla.com>
X-Sender: test@bla.com
User-Agent: RoundCube Webmail/4.1
Content-Type: multipart/mixed;
	boundary="=_c6349fbd756ce0e469d3e7af559d813c"

--=_c6349fbd756ce0e469d3e7af559d813c
Content-Type: multipart/alternative;
	boundary="=_71aac874fbbd481b35935d5419dfcab0"

--=_71aac874fbbd481b35935d5419dfcab0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

vsdfvgdfvsdf
--=_71aac874fbbd481b35935d5419dfcab0
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

vsdfvgdfvsdf

--=_71aac874fbbd481b35935d5419dfcab0--

--=_c6349fbd756ce0e469d3e7af559d813c
Content-Transfer-Encoding: base64
Content-Type: application/msword; name="Testik.xls"; charset="UTF-8"
Content-Disposition: attachment; filename="Testik.xls"

As you can see, XLS has really bad mime detection.

It should have something like this:


Content-Type: application/vnd.ms-excel;

name="Testik.xls"

Content-Transfer-Encoding: base64 Content-Disposition: attachement;

filename="Testik.xls"

So could you please test it with XLS? this problem is repeatable.

Thank you Reg. Tomas Vobruba

Change History

in reply to: ↑ description   Changed 2 months ago by mp

Yes,

we're experiencing the same problem even with 0.2-alpha and with last nightly update. We've tryed them over Debian and RedHat? with same results.

Can we help in some way?

Regards, Maximiliano Replying to tomeek:

Hello all, I have discovered that this ticket was already here. But was closed as it was working. But, this check was incorrect. I'm using stable version 1.1 of roundcube mail and users are complaining that MS Excel attachements are badly detected like a MS World. See this email source: MIME-Version: 1.0 Date: Mon, 23 Jun 2008 15:07:42 +0200 From: Tomas Vobruba <blabla@…> To: test@… Subject: ttt Reply-To: test@… Message-ID: <f46f5ba5537c28fc5913b406d4e70809@…> X-Sender: test@… User-Agent: RoundCube Webmail/4.1 Content-Type: multipart/mixed; boundary="=_c6349fbd756ce0e469d3e7af559d813c" --=_c6349fbd756ce0e469d3e7af559d813c Content-Type: multipart/alternative; boundary="=_71aac874fbbd481b35935d5419dfcab0" --=_71aac874fbbd481b35935d5419dfcab0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable vsdfvgdfvsdf --=_71aac874fbbd481b35935d5419dfcab0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable vsdfvgdfvsdf --=_71aac874fbbd481b35935d5419dfcab0-- --=_c6349fbd756ce0e469d3e7af559d813c Content-Transfer-Encoding: base64 Content-Type: application/msword; name="Testik.xls"; charset="UTF-8" Content-Disposition: attachment; filename="Testik.xls" As you can see, XLS has really bad mime detection. It should have something like this: --------------010305050100000704050309 Content-Type: application/vnd.ms-excel; name="Testik.xls" Content-Transfer-Encoding: base64 Content-Disposition: attachement; filename="Testik.xls" So could you please test it with XLS? this problem is repeatable. Thank you Reg. Tomas Vobruba

  Changed 2 months ago by tomeek

Yes please,

correct this bug ;-) this is not a problem of mimetools on the system. they are detecting file ok, so this should be somewhere in php code. Problem is that Roundcubemail imap web client is unusable if there is bug like this. users can't send xls attachements.

  Changed 6 weeks ago by thomasb

  • status changed from new to closed
  • resolution set to fixed
  • component changed from Core functionality to PHP backend
  • description modified (diff)
  • milestone changed from later to 0.2-beta

We now prefer file_info() over mime_content_type() which is deprecated. Please test with svn r1610

  Changed 4 weeks ago by hatolf

I've had the same issue with Version 0.1.1. Switch to svn version was no option for me. To fix this I've installed php-extension fileinfo and changed function rc_mime_content_type in program/include/rcube_shared.inc to:

function rc_mime_content_type($path, $failover = 'unknown/unknown')
{
    global $CONFIG;
    $mime_magic = $CONFIG['mime_magic'];

    if (!extension_loaded('fileinfo')) {
           @dl('fileinfo.' . PHP_SHLIB_SUFFIX);
    }
    if (function_exists('finfo_open')) {
           if ($finfo = finfo_open(FILEINFO_MIME, $mime_magic)) {
                   $mime_type = finfo_file($finfo, $path);
                   finfo_close($finfo);
            }
    }
    else if (function_exists('mime_content_type')) {
              $mime_type = mime_content_type($path);
    }
    if (!$mime_type) {
        $mime_type = $failover;
    }
    return $mime_type;
}


Note: See TracTickets for help on using tickets.