Closed Bug 1138372 Opened 9 years ago Closed 9 years ago

[contacts] Contacts app needs to register for text/directory MIME type for its open activity. (vcard attachments received from outlook/iphone 5 clients may not be opened by mail app while you can open them from Downloads)

Categories

(Firefox OS Graveyard :: Gaia::Contacts, defect)

All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:2.2+, b2g-v2.2 fixed, b2g-master fixed)

RESOLVED FIXED
2.2 S7 (6mar)
blocking-b2g 2.2+
Tracking Status
b2g-v2.2 --- fixed
b2g-master --- fixed

People

(Reporter: brg, Assigned: hola)

References

Details

Attachments

(4 files, 1 obsolete file)

Attached image 2015-03-02-12-10-24.png
Tested today using Flame+V18D- Gecko-75fc721.Gaia-1e2f3de.
STR:
- Configure mail account
- Receive different vcf files from Android, Outlook, iphone 5S, iphone 6 and check the behaviour.

Files sent from Android and iphone 6 are properly managed by mail app client.

However files sent from Outlook(version 14.4.7 (141117)) and iphone 5S( Version: 8.0 (12A365)) are not opened in mail app client (see screenshot of the error shown) while if user goes to Downloads menu, those files are opened.
Tested with Friday build Flame-v18D-Gecko-c4a1019.Gaia-c1da118, the issue does not reproduce.

Mail client app can open vcf files received from Iphone 5S and Outlook mail clients.
The answer probably has to do with our MIME type mapping in email being different than what the downloads logic is doing since we also have access to what the sending mail client sent us and we try to be clever with precedence.

Do you have/can you provide a logcat from a run that reproduces?  This will potentially save me a lot of time in figuring out what is going wrong, and is one of the reasons we always ask for a logcat.  Thanks!
Flags: needinfo?(beatriz.rodriguezgomez)
Attached file Bug1138372_Iphone.txt
logcat from iphone
Attached file log_outlook.txt
Logcat from Outlook.
Flags: needinfo?(beatriz.rodriguezgomez)
So, per the logcat we're trying to trigger an activity using the "text/directory" MIME type.  This is apparently a deprecated MIME type for the canonical text/vcard type per http://tools.ietf.org/html/rfc6350#section-10.1 along with "text/directory; profile=vcard" (which is still the same MIME type, but with a parameter), and "text/x-vcard".  GAIA/apps/contacts/js/view/settings.js appears to be aware of the text/directory variants in its "onSdImport" function.

The log indicates that the sender of the message has explicitly indicated the MIME type to be "text/directory" and the email app does not second guess it.  (If it were "application/octet-stream" as the outlook.com web UI sent in my test, we would second guess and we would conclude the MIME type should be "text/vcard".)

Since text/directory is a known MIME type for vcards and history has shown it's a bad idea from a security perspective to second-guess MIME types on the basis of file-extensions (or at least to use them inconsistently! :), I think the thing that makes the most sense here is for the contacts app to update its web activity filter to also process the "text/directory" MIME type in addition to "text/vcard" and "text/x-vcard" that is already supports.  (The good news is this will not require a make reset-gaia, although b2g itself may need to be restarted for the new activity filter to be processed.)

I'll provide a patch for this in a second.
Assignee: nobody → bugmail
Status: NEW → ASSIGNED
Component: Gaia::E-Mail → Gaia::Contacts
Summary: vcard attachments received from outlook/iphone 5 clients are not opened by mail app while you can open them from Downloads → [contacts] Contacts app needs to register for text/directory MIME type for its open activity. (vcard attachments received from outlook/iphone 5 clients may not be opened by mail app while you can open them from Downloads)
Comment on attachment 8571533 [details] [review]
[gaia] asutherland:contacts-support-directory-mime-type > mozilla-b2g:master

I'm providing what I think is a straightforward fix for this, but please feel free to take the bug and patch over if you would like something more involved.  (I unfortunately won't be able to spend a lot of cycles on this.)

This patch updates the manifest for a few places where it looks like all 3 MIME types were desired.  I also noticed a potential bug in the handling of pick types.  If pick was used with "text/x-vcard", it would not do the right thing, and if naively fixed, it would have accidentally exported the Facebook data, I believe.
Attachment #8571533 - Flags: review?(jmcf)
Comment on attachment 8571533 [details] [review]
[gaia] asutherland:contacts-support-directory-mime-type > mozilla-b2g:master

I've tested the patch and it does not work. I'm unable to attach a vcard to an MMS message.
Attachment #8571533 - Flags: review?(jmcf) → review-
As Andrew said that he cannot spend many cycles on this, I'm going to reassign this to Adrian.
Assignee: bugmail → hola
Comment on attachment 8572016 [details] [review]
[gaia] ADLR-es:dep-vcard-mime-types > mozilla-b2g:master

Based upon Andrew's patch.
Attachment #8572016 - Flags: review?(jmcf)
Attachment #8571533 - Attachment is obsolete: true
Comment on attachment 8572016 [details] [review]
[gaia] ADLR-es:dep-vcard-mime-types > mozilla-b2g:master

LGTM, thanks Adrian.
Attachment #8572016 - Flags: review?(jmcf) → review+
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2.2 S7 (6mar)
We had just tested Flame today build based in v18D from master( Gecko-71741ed.Gaia-a307d38) the vcard attachments received in mail app from Outlook and Iphone 5 can be opened.
Thanks for fixing it.
We need this fix en 2.2 to make this feature fully work. It blocks bug 825318 approved to be in 2.2.
blocking-b2g: --- → 2.2?
triage: we need this to make the use case complete.
blocking-b2g: 2.2? → 2.2+
Comment on attachment 8572016 [details] [review]
[gaia] ADLR-es:dep-vcard-mime-types > mozilla-b2g:master

[Approval Request Comment]
[Bug caused by] (feature/regressing bug #): Opening attachments from email.
[User impact] if declined: Some vCard from outlook, iOS and others won't be opened from email.
[Testing completed]: Manual testing, unit tests included.
[Risk to taking this patch] (and alternatives if risky): Low risk, small change. If not taken, some vCards won't be recognized as a vCard file.
[String changes made]: None.
Attachment #8572016 - Flags: approval-gaia-v2.2?
Attachment #8572016 - Flags: approval-gaia-v2.2? → approval-gaia-v2.2+
(In reply to Beatriz Rodríguez [:brg] from comment #0)
> Created attachment 8571286 [details]
> 2015-03-02-12-10-24.png
> 
> Tested today using Flame+V18D- Gecko-75fc721.Gaia-1e2f3de.
> STR:
> - Configure mail account
> - Receive different vcf files from Android, Outlook, iphone 5S, iphone 6 and
> check the behaviour.
> 
> Files sent from Android and iphone 6 are properly managed by mail app client.
> 
> However files sent from Outlook(version 14.4.7 (141117)) and iphone 5S(
> Version: 8.0 (12A365)) are not opened in mail app client (see screenshot of
> the error shown) while if user goes to Downloads menu, those files are
> opened.

Can you please help confirm the issue is fixed for you now ?
(In reply to bhavana bajaj [:bajaj] from comment #18)
> Can you please help confirm the issue is fixed for you now ?
yes-in master. I will check in 2.2 as soon as it lands there.
Tested with today build in Flame v2.2(Gecko-5d15383.Gaia-3f03223) the vcard files received from iphone 5 and Outlook are properly displayed.
Thanks again to everyone helping to fix it.
After reading https://bugzilla.mozilla.org/show_bug.cgi?id=825318#c140, I will test again in few days :-)
Testing again version 2.2 after landing bug 825318, Gecko-fe5b385.Gaia-572d60e, the vcards received in mail client from Iphone5 and outlook are properly displayed. Thanks!
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: