nextcloud / contacts

📇 Contacts app for Nextcloud
https://apps.nextcloud.com/apps/contacts
GNU Affero General Public License v3.0
568 stars 173 forks source link

Incompliant (?) V3.0 vcard when exporting from Nextcloud #1899

Open michaelof opened 3 years ago

michaelof commented 3 years ago

(Nextcloud 20.0.1, OpenSuse Leap 15.2)

Not sure if Contacs app or cardDAV specific, please advice if this issue should be opened in server repo.

https://docs.nextcloud.com/server/20/user_manual/en/pim/contacts.html?highlight=vcard#importing-virtual-contacts says that

The Contacts app only supports import of vCards version 3.0 and 4.0.

Importing this V4.0 vcard:

BEGIN:VCARD
VERSION:4.0
FN:Först Last
TEL;VALUE=uri;TYPE="CELL":tel:+491234567890
TEL;VALUE=uri;TYPE="VOICE,HOME":tel:+499876543210
END:VCARD

to my nextcloud is possible: image

When exporting this contact, as Nextcloud offers (afaik?) only V3.0 exports, the following vcard is resulting:

BEGIN:VCARD
VERSION:3.0
PRODID:-//Sabre//Sabre VObject 4.3.0//EN
FN:Först Last
TEL;TYPE=CELL:tel:+491234567890
TEL;TYPE="VOICE,HOME":tel:+499876543210
UID:444b38a4-3bda-4a53-a9e7-c40d357f69b5
REV;VALUE=DATE-TIME:20201028T122702Z
END:VCARD

RFC 6350 (VCARD 4.0) specifies, that V4.0 compliant TEL properties

... SHOULD be reset to a URI value.  It is expected that the URI scheme will be "tel", as
      specified in [RFC3966], but other schemes MAY be used.

(https://tools.ietf.org/html/rfc6350#section-6.4.1)

Whereas RFC 2426 (VCARD 3.0) specifies, that V3.0 compliant TEL properties should be

Type value: A single phone-number value.

Type special notes: The value of this type is specified in a
canonical form in order to specify an unambiguous representation of
the globally unique telephone endpoint. This type is based on the
X.500 Telephone Number attribute.

So IMHO the V3.0 exported vcard from nextcloud must not contain the "tel:" URI part, anymore.

Containing this URI "fragment" e.g. results in somewhat unusable Android contacts, when synched from Nextcloud via DAVx5: TEL property simply ignored, no phone numbers synched/detected.

plutocrat commented 3 years ago

I can confirm this too. I'm trying to clean up some contacts. I've tried a number of ways to export, using Cardbook for Thunderbird cadaver, vdirsyncer and direct export from the Contacts app, and it seems that cards are only exported as 3.0. Surely it should try to retain the version number? I can compare the same contact in Thunderbird / Cardbook, and it says version 4.

Is there a way of requesting a minimum version in the export command? Or is there a setting in SaberDAV config which we can set?

Just for info one of the problems I'm trying to address is that my contacts have been amassed over a long period of many years, and they all have different date formats, PRODID strings, VERSIONS, and some bad UUID numbers, so I'm trying to clean them all up and standardise them.