﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
1484062	Wrong MimeType while attaching files.	fjgm	till	"There's a small issue with roundcube while attaching certain files. Roundcube trusts that the browser will send the correct Mimetype which seems fine, but not all browsers do this right.

I have been experiencing problems with Firefox and various versions of roundcube while attaching PDF files because somehow Firefox recognizes them as text/html and not as application/pdf ; when the email composed with roundcube is received the attachment can be downloaded but its imposible to open because the mimetype is wrong.

I was able to fix this behaviour by ignoring the mimetype sent by the browser and forcing the application to query the true mimetype of the file by means of the ""mime_content_type()"" function.


File: program/steps/mail/sendmail.inc
{{{

// add stored attachments, if any
if (is_array($_SESSION['compose']['attachments']))
  foreach ($_SESSION['compose']['attachments'] as $attachment)
    $MAIL_MIME->addAttachment($attachment['path'], $attachment['mimetype'], $attachment['name'], TRUE);

}}}

Was replaced with:
{{{

// add stored attachments, if any
if (is_array($_SESSION['compose']['attachments']))
  foreach ($_SESSION['compose']['attachments'] as $attachment)
    $MAIL_MIME->addAttachment($attachment['path'], mime_content_type($attachment['path']), $attachment['name'], TRUE);

}}}

"	Bugs	closed	5	0.1-stable	PHP backend		normal	fixed		
