thunderbird / thunderbird-android

Thunderbird for Android – Open Source Email App for Android (fka K-9 Mail)
https://thunderbird.net/mobile
Apache License 2.0
11.04k stars 2.51k forks source link

Mime-Type is application/octet-stream instead of application/vnd-com.apple.pkpass #1357

Closed ligi closed 8 years ago

ligi commented 8 years ago

Expected behaviour

When opening a mail with attached pkpass file the mime-type with the intent should be application/vnd-com.apple.pkpass as in gmail

Actual behaviour

The mime-type is application/octet-stream for the same mail that opens with application/vnd-com.apple.pkpass in gmail

Steps to reproduce

  1. create a mail with attached pkpass file
  2. click on the attachment
  3. see the mime-type (e.g. with intent-intercept)

    Environment

K-9 Mail version: 5.010

Android version: 5.1.1

Account type (IMAP, POP3, WebDAV/Exchange):IMAP

cketti commented 8 years ago

When opening an attachment the MIME type from the email is used. If that type is application/octet-stream we try to find a better one using MimeTypeMap.getMimeTypeFromExtension(). If that also fails we fall back to MimeUtility.MIME_TYPE_BY_EXTENSION_MAP.

We can add support for .pkpass in MIME_TYPE_BY_EXTENSION_MAP. But this is fixing the problem at the wrong end. Try to send emails containing the correct MIME type. Also, try to get .pkpass support into the system's MimeTypeMap.

ligi commented 8 years ago

Unfortunately I am not controlling the sending end - so https://github.com/k9mail/k-9/pull/1358 is greatly appreciated