Bug 300869 - Addressbook messaging entries doesn't follow the RFC
Summary: Addressbook messaging entries doesn't follow the RFC
Status: RESOLVED FIXED
Alias: None
Product: kaddressbook
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-30 12:29 UTC by Thomas Tanghus
Modified: 2013-04-03 12:03 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.9.2


Attachments
Quick and dirty patch to sync messaging tags to owncloud (458 bytes, patch)
2013-04-03 11:40 UTC, Jan Boysen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Tanghus 2012-05-30 12:29:33 UTC
When you enter a messaging protocol through the popup (btw: I would have never found out how to change protocol if someone hadn't told me) it writes an entry in the form:

X-MESSAGING/SKYPE-ALL:somehandle

This violates the RFC [1]  because slashes are not allowed:

   x-name       = "X-" 1*(ALPHA / DIGIT / "-")
        ; Reserved for non-standard use

I discovered this because of a bug report for ownCloud where some vcards failed to import. So at least SabreDAV which is used by ownCloud cannot parse vcards with IM entries created by KAddressbook.

[1] https://tools.ietf.org/html/rfc2426#section-4
[2] https://code.google.com/p/sabredav/

Reproducible: Always

Steps to Reproduce:
1. Create a contact in KAddressbook and add an IM address.
2.  Export to vcf.
3. Import to ownCloud.
Actual Results:  
The import fails with the error "line N did not follow the icalendar/vcard format".

Expected Results:  
The import shouldn't fail because of malformed vcard.

KDE 4.8.3
KDE-PIM 4.8.2
Kubuntu 11.10
ownCloud 4.0
Comment 1 Laurent Montel 2012-06-29 07:31:24 UTC
I confirm it.
Comment 2 Sebastian L 2012-07-19 18:50:10 UTC
*** This bug has been confirmed by popular vote. ***
Comment 3 Laurent Montel 2012-08-17 20:25:46 UTC
Git commit da45490e74c0ab5a19cf69ac2b445b6a5c771a8e by Montel Laurent.
Committed on 17/08/2012 at 22:24.
Pushed by mlaurent into branch 'KDE/4.9'.

Fix Bug 300869 - Addressbook messaging entries doesn't follow the RFC

Need kdepim too.

FIXED-IN: 4.9.1

M  +1    -1    CMakeLists.txt
M  +15   -0    kabc/vcardconverter.cpp
M  +9    -0    kabc/vcardconverter.h
M  +40   -1    kabc/vcardtool.cpp
M  +8    -0    kabc/vcardtool.h

http://commits.kde.org/kdepimlibs/da45490e74c0ab5a19cf69ac2b445b6a5c771a8e
Comment 4 Laurent Montel 2012-08-17 20:27:22 UTC
Git commit ac7307dc3a775088b175ba948c49bf305fb958cd by Montel Laurent.
Committed on 17/08/2012 at 22:26.
Pushed by mlaurent into branch 'KDE/4.9'.

Fix Bug 300869 - Addressbook messaging entries doesn't follow the RFC

Need kdepimlibs

FIXED-IN: 4.9.1

M  +1    -1    CMakeLists.txt
M  +6    -6    kaddressbook/xxport/vcard/vcard_xxport.cpp

http://commits.kde.org/kdepim/ac7307dc3a775088b175ba948c49bf305fb958cd
Comment 5 Thomas Tanghus 2012-08-17 21:42:48 UTC
> FIXED-IN: 4.9.1

Nice, thanks :-)
Comment 6 Stéphane Pontier 2012-09-18 15:14:55 UTC
Hi, I was also hit by the bug using kde 4.9.0 and now with 4.9.1, I can see that there is still a:
X-messaging/irc-All:usernick
entry in my exported cardfile that prevent it to be imported into owncloud
Comment 7 Laurent Montel 2012-09-22 21:32:25 UTC
Git commit b5e4acbe29d5ed10b0fdaf6868e3d827bd10fb6c by Montel Laurent.
Committed on 22/09/2012 at 21:04.
Pushed by mlaurent into branch 'KDE/4.9'.

Fix 300869 Addressbook messaging entries doesn't follow the RFC

FIXED-IN: 4.9.2

M  +4    -0    kabc/vcardtool.cpp

http://commits.kde.org/kdepimlibs/b5e4acbe29d5ed10b0fdaf6868e3d827bd10fb6c
Comment 8 Sven Wehner 2012-09-22 22:01:12 UTC
Hi,
I have this problem ("X-messaging/icq-All") with KDE 4.9.1 when I try to drag-and-drop the contacts from one addressbook (local) to another (owncloud).
If I export all contacts to a file the "X-messaging/icq-All" lines are all replaced by "X-ICQ".
Could it be that a copy/move within kaddressbook doesn't call VCardTool::exportVCards(), but VCardTool::createVCards()? The latter one would call VCardTool::createVCards() (the private one with three arguments!) with bool exportVcard set to false.

The file kabc/vcarddrag.cpp seems to be the right place (I haven't yet fully understood the EntityTreeView, EntityTreeModel, DropEvent stuff). The method VCardDrag::populateMimeData() calls KABC::VCardConverter::createVCards().

So could you please either replace createVCards() by exportVCards(), or add a check/replace to the part when the data is processed by the destination (somewhere in EntityTreeModel::dropMimeData(), I guess)?

(Shall I file an independent bug for the drag and drop?)
Comment 9 Laurent Montel 2012-09-24 17:22:02 UTC
a dnd direct doesn't use createVcard and co it copy directly data.
So don't know how to fix it.
Comment 10 Thomas Tanghus 2012-09-30 06:33:54 UTC
(In reply to comment #8)
> If I export all contacts to a file the "X-messaging/icq-All" lines are all
> replaced by "X-ICQ".

Why not use RFC 4770 instead of "X-*" fields btw? It will be incorporated in the vCard 4 spec. I have solely implemented IMPP fields for ownCloud Contacts.

http://www.faqs.org/rfcs/rfc4770.html
Comment 11 Thomas Tanghus 2012-10-24 16:21:22 UTC
Now if you for example add two Jabber/XMPP accounts to one contact, they are separated by a non-utf-8 character I can't quite determine what is.

X-JABBER:xxx@jabber.orgxxx@dukgo.com

Again, why not use a proposed standard, which will be in the next vCard version, instead of some X-* names that are bound to be obsoleted.
Comment 12 Jan Boysen 2013-04-03 11:38:28 UTC
Hi @all,

The same issue seems to affect the DAV-Groupware-Resource sync functionality from akonadi, as its using createVCard() in resources/dav/common/davutils.cpp.

So a Vcard read from owncloud containing messaging tags are converted to X-Messaging in KDEPIM so they can not be pushed back to owncloud upon modification as its not converted back.

I've created a quick and dirty patch Ill attach here to resolve it for me, but Im not familiar with KDE's code, so I don't know if it has some side effects.
Comment 13 Jan Boysen 2013-04-03 11:40:14 UTC
Created attachment 78598 [details]
Quick and dirty patch to sync messaging tags to owncloud
Comment 14 Grégory Oestreicher 2013-04-03 12:03:00 UTC
Hi Jan,

(In reply to comment #12)
> I've created a quick and dirty patch Ill attach here to resolve it for me,

Thanks for your patch. The same issue has been fixed the same way for 4.10.2, so your patch is not dirty :)

Thanks,
Grégory