Re: carddav unexpectedly downgrades vcard 4 to vcard 3
Дилян Палаузов <[email protected]> Fri, 15 May 2026 08:46:52 +0300
| Newsgroups | gmane.mail.imap.cyrus |
|---|---|
| Message-ID | <[email protected]> |
Hello Bill, content-type must be in small letters, in your citation it is Content-Type.= Compare to https://datatracker.ietf.org/doc/html/rfc6352#section-8.7.2 . Greetings // =D0=94=D0=B8=D0=BB=D1=8F=D0=BD -----Original Message----- From: Bill Sommerfeld via Info <[email protected]> Reply-To: Info <[email protected]> To: [email protected] Subject: carddav unexpectedly downgrades vcard 4 to vcard 3 Date: 15/05/26 00:47:25 I've recently set up carddav service in my Cyrus installation (running my b= uild of 3.12.2) and attempted to use it to store vcard 4.0 contacts using t= he Thunderbird Cardbook extension. I can add cyrus as a carddav store, and store vcard 4.0 information into it= - the files in the mailstore are all in vcard 4 format - but when I set up= a second Thunderbird Cardbook client, all the cards are fetched as vcard 3= format. I dug into it a bit - adding debug syslogs to callers of vcard_to_v3() - an= d I think I know why. The conversion is happening in propfind_addrdata() in imap/http_carddav.c Cardbook fetches the cards with a REPORT request with a bit of xml (I've fo= rmatted it with xmllint -format): <?xml version=3D"1.0" encoding=3D"utf-8"?> <C:addressbook-multiget xmlns:D=3D"DAV:" xmlns:C=3D"urn:ietf:params:xml:ns:= carddav"> =C2=A0=C2=A0 <D:prop> =C2=A0=C2=A0=C2=A0=C2=A0 <D:getetag/> =C2=A0=C2=A0=C2=A0=C2=A0 <C:address-data Content-Type=3D"text/vcard" versio= n=3D"4.0"/> =C2=A0=C2=A0 </D:prop> =C2=A0=C2=A0 <D:href>/dav/addressbooks/shared/b26c6ba9-297a-4154-81fb-e8861= 901be2f.vcf</D:href> =C2=A0=C2=A0 <D:href>/dav/addressbooks/shared/4eadf833-0517-4909-b5ff-0b3e3= 2b8ddb0.vcf</D:href> =C2=A0=C2=A0 <D:href>/dav/addressbooks/shared/e6e0275d-3338-4198-9616-0b397= 8003550.vcf</D:href> =C2=A0=C2=A0 <D:href>/dav/addressbooks/shared/4426323c-f3cc-4cde-a6fe-05230= fca8b0c.vcf</D:href> =C2=A0=C2=A0 <D:href>/dav/addressbooks/shared/f37c7416-f065-44ce-89d9-4b444= 12a5d86.vcf</D:href> </C:addressbook-multiget> Note the C:address-data element with Content-type=3D"text/vcard" and versio= n=3D"4.0" indicating that it wants vcard 4. Looking at propfind_addrdata(), it only ever uses the default carddav struc= t mime_type_t (which is vcard 3); nothing looks at the request and steps th= rough the alternate mime_type_t's to find one which matches what the client= is asking for. I have a somewhat kludgy patch for this against 3.12 but I also see there's= been a bit of recent work on http_carddav.c in 3.13; I'd appreciate sugges= tions on the best way to get this fixed for real.. =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 - Bill ------------------------------------------ Cyrus: Info Permalink: https://cyrus.topicbox.com/groups/info/T40ea562d07888bd7-Mb588c0= a6f933fe1879b01625 Delivery options: https://cyrus.topicbox.com/groups/info/subscription