Bug 390900 - Import vcf from email does not work
Summary: Import vcf from email does not work
Status: RESOLVED FIXED
Alias: None
Product: kmail2
Classification: Applications
Component: commands and actions (show other bugs)
Version: 5.5.1
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-22 12:29 UTC by BingMyBong
Modified: 2019-06-18 11:59 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.11.3


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description BingMyBong 2018-02-22 12:29:14 UTC
There is a link [Add this contact to the address book] in the message area of an email that has an attached business card that should allow you to import it directly into your contacts. Clicking on this link does nothing.  You have to save the file to disk and then import via the contacts. 
This is what is displayed in the bottom left hand corner of kmail when you click on the link: x-kmail:/bodypart/1/2/addToAddressBook%3A0
Comment 1 Laurent Montel 2018-02-22 13:02:39 UTC
Is it possible to send me this email as private ?
So I can test it.
thanks
Comment 2 BingMyBong 2018-02-23 10:59:28 UTC
(In reply to Laurent Montel from comment #1)
> Is it possible to send me this email as private ?
> So I can test it.
> thanks

Will do. A bit of background, on this bingmybong account there were no address books because its just for mailing lists. I sent to emails to this account, one as a "Forward Inline" (this doesn't work) and a fresh new email with attached the VCF file (this works).  I'll send the broken one to you with the bug number in the subject
Comment 3 BingMyBong 2018-02-23 11:01:43 UTC
(In reply to Laurent Montel from comment #1)
> Is it possible to send me this email as private ?
> So I can test it.
> thanks

do you mean the "montel@kde.org" address?
Comment 4 Laurent Montel 2018-02-23 14:45:31 UTC
(In reply to BingMyBong from comment #3)
> (In reply to Laurent Montel from comment #1)
> > Is it possible to send me this email as private ?
> > So I can test it.
> > thanks
> 
> do you mean the "montel@kde.org" address?

yep :)
Comment 5 BingMyBong 2018-02-23 16:23:39 UTC
(In reply to Laurent Montel from comment #4)
> (In reply to BingMyBong from comment #3)
> > (In reply to Laurent Montel from comment #1)
> > > Is it possible to send me this email as private ?
> > > So I can test it.
> > > thanks
> > 
> > do you mean the "montel@kde.org" address?
> 
> yep :)

I sent them without waiting so hopefully you got them ok. One thing i noticed as well. I successfully imported it into my personal address book within kontact but it would not obey alphabetical order, it stayed at the top of the list until i changed the name and then changed it back.
Comment 6 Helmar Gerloni 2019-06-13 19:13:54 UTC
Same problem here on Kmail 4:19.04.2+p18.04+git20190611.0020-0 from KDE Neon (and also on Debian Buster).

I tried the following:

1. Send VCF contact from Outlook to Kmail
   Click on "[Add this contact to the address book]" in Kmail does nothing. Error shown on console:
   org.kde.pim.kmail: Can't handle URL: QUrl("x-kmail:/bodypart/1/2/addToAddressBook%3A0")

2. Forward the same mail as attachment from Kmail to Kmail
   Same behavior, similar error message

3. Forward the same mail inline from Kmail to Kmail
   No VCF file is attached to the forwarded mail, only a text line "[Name of contact]" shows up in the mail
   (Inline-forwarding other mails with attachments preserves the attachments)

4. Save the original contact from the Outlook mail to disk and send it as attachment from Kmail to Kmail
   Contact can be imported as expected

So it seems that the problem is not the VCF file itself, but the "surrounding" mail.
Comment 7 Laurent Montel 2019-06-14 05:37:16 UTC
(In reply to Helmar Gerloni from comment #6)
> Same problem here on Kmail 4:19.04.2+p18.04+git20190611.0020-0 from KDE Neon
> (and also on Debian Buster).
> 
> I tried the following:
> 
> 1. Send VCF contact from Outlook to Kmail
>    Click on "[Add this contact to the address book]" in Kmail does nothing.
> Error shown on console:
>    org.kde.pim.kmail: Can't handle URL:
> QUrl("x-kmail:/bodypart/1/2/addToAddressBook%3A0")
> 
> 2. Forward the same mail as attachment from Kmail to Kmail
>    Same behavior, similar error message
> 
> 3. Forward the same mail inline from Kmail to Kmail
>    No VCF file is attached to the forwarded mail, only a text line "[Name of
> contact]" shows up in the mail
>    (Inline-forwarding other mails with attachments preserves the attachments)
> 
> 4. Save the original contact from the Outlook mail to disk and send it as
> attachment from Kmail to Kmail
>    Contact can be imported as expected
> 
> So it seems that the problem is not the VCF file itself, but the
> "surrounding" mail.

Do you have a example ?
could you send me it please ?
Comment 8 Laurent Montel 2019-06-14 11:48:42 UTC
> Do you have a example ?
> could you send me it please ?

Thanks.
I can confirm the bug.
I will work on it now.
Comment 9 Helmar Gerloni 2019-06-14 11:51:55 UTC
(In reply to Laurent Montel from comment #8)
> I can confirm the bug.
> I will work on it now.
Thanks! Interesting detail I just found out: While you are not able to import the contact using the link "[Add this contact to the address book]" in the mail it works perfectly using the small link "[vcard]" in the mail header "From: sender@example.com [vcard]".
Comment 10 Laurent Montel 2019-06-17 05:58:21 UTC
(In reply to Helmar Gerloni from comment #9)
> (In reply to Laurent Montel from comment #8)
> > I can confirm the bug.
> > I will work on it now.
> Thanks! Interesting detail I just found out: While you are not able to
> import the contact using the link "[Add this contact to the address book]"
> in the mail it works perfectly using the small link "[vcard]" in the mail
> header "From: sender@example.com [vcard]".

yep I know it's a problem with vcard plugin. So [vcard] will work correctly
Comment 11 Laurent Montel 2019-06-18 11:59:20 UTC
Git commit 3701dd6e1d31e90f5319965fa1d59c3edbc33948 by Laurent Montel.
Committed on 18/06/2019 at 11:59.
Pushed by mlaurent into branch 'Applications/19.04'.

Fix Bug 390900 - Import vcf from email does not work

FIXED-IN: 5.11.3

M  +5    -1    messageviewer/src/viewer/urlhandlermanager.cpp

https://commits.kde.org/messagelib/3701dd6e1d31e90f5319965fa1d59c3edbc33948