carddav unexpectedly downgrades vcard 4 to vcard 3

"Bill Sommerfeld via Info" <[email protected]> Thu, 14 May 2026 14:47:25 -0700
Newsgroups gmane.mail.imap.cyrus
Message-ID <[email protected]>
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">
   <D:prop>
     <D:getetag/>
     <C:address-data Content-Type=3D"text/vcard" version=3D"4.0"/>
   </D:prop>
   <D:href>/dav/addressbooks/shared/b26c6ba9-297a-4154-81fb-e8861901be2f.vc=
f</D:href>
   <D:href>/dav/addressbooks/shared/4eadf833-0517-4909-b5ff-0b3e32b8ddb0.vc=
f</D:href>
   <D:href>/dav/addressbooks/shared/e6e0275d-3338-4198-9616-0b3978003550.vc=
f</D:href>
   <D:href>/dav/addressbooks/shared/4426323c-f3cc-4cde-a6fe-05230fca8b0c.vc=
f</D:href>
   <D:href>/dav/addressbooks/shared/f37c7416-f065-44ce-89d9-4b44412a5d86.vc=
f</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..

                                        - Bill









------------------------------------------
Cyrus: Info
Permalink: https://cyrus.topicbox.com/groups/info/T40ea562d07888bd7-Md1198f=
cc0ce180c541005ece
Delivery options: https://cyrus.topicbox.com/groups/info/subscription