Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ligi opened this issue May 7, 2016 · 4 comments · Fixed by #1358
Closed

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

ligi opened this issue May 7, 2016 · 4 comments · Fixed by #1358

Comments

@ligi
Copy link
Contributor

ligi commented May 7, 2016

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
Copy link
Member

cketti commented May 7, 2016

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
Copy link
Contributor Author

ligi commented May 7, 2016

Unfortunately I am not controlling the sending end - so #1358 is greatly appreciated

@erAck
Copy link

erAck commented Jan 11, 2025

Lol, 8 years and still the wrong fix, though I didn't check if the map is even still used, it's legacy now

{ "pkpass", "application/vnd-com.apple.pkpass" },

It should had been application/vnd.apple.pkpass instead, see https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/PassKit_PG/DistributingPasses.html
Just because GMail does something it doesn't mean it's correct..

@kewisch
Copy link
Member

kewisch commented Jan 13, 2025

Fair point, legacy stuff and standards can be tricky to keep track of—though no need to twist the knife. It looks like you know your way around these. If you have some cycles to spare I'd appreciate if you could take a look and see what the best approach would be going forward, e.g. changing the mime type. A new issue with details, or a pull request, would be very welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants