Project

General

Profile

Actions

Feature #19131

closed

Use a better content type for attachments created with application/octet-stream

Added by Felix Schäfer about 11 years ago. Updated about 11 years ago.

Status:
Closed
Priority:
Normal
Category:
Email receiving
Target version:
Resolution:
Fixed

Description

Some email clients will always send attachments with a mime-type of application/octet-stream instead of correctly setting the attachment of the mime-type. We are aware of Outlook 15 showing this behaviour, but it might not be the only one.

This is a problem in the case where the front-end web server behind which Redmine runs sends the X-Content-Type-Options: nosniff header, which stops the browser from trying to guess the mime type of files the server sends it (this header is set on the Planio platform for security reasons).

This combination leads to thumbnails not being shown:
  • Redmine blindly trusts the mime-type set by the email client source:/branches/2.6-stable/app/models/mail_handler.rb#L276
  • This mime-type gets stored to the DB
  • And is served back as the Content-Type of the corresponding thumbnail source:/branches/2.6-stable/app/controllers/attachments_controller.rb#L63
  • The browser tries to fetch the thumbnail but gets a file with the Content-Type set to application/octet-stream, which isn't considered an image and a broken link/broken image is shown.

Files

19131.patch (18.6 KB) 19131.patch Felix Schäfer, 2015-02-18 20:58
Actions

Also available in: Atom PDF