Hello,
We encountered an encoding problem when a contact is created with character that needs encoding on an Exchange server, namely character & :
BEGIN:VCARD
VERSION:3.0
FN:MYTESTNAME
N:MYTESTNAME;;;;
ORG:MYTESTNAME
UID:202009241120
END:VCARD
curl -v \
-T curl-vcard.txt \
-H "Content-Type: text/vcard; charset=utf-8" \
--request PUT \
--user <email>:<password> \
http://<davmailurl>:60080/users/<email>/contacts/T%20E%20S%26amp%3BT.vcf</email></davmailurl></password></email>
<d:propfind xmlns:d="DAV:" xmlns:cs="http://calendarserver.org/ns/">
<d:prop>
<d:displayname>
<cs:getctag>
<d:resourcetype>
</d:resourcetype></cs:getctag></d:displayname></d:prop>
</d:propfind>
curl -v \
--request PROPFIND \
--header "Content-Type: application/xml; charset=utf-8" \
--header "Depth: 1" \
--data @curl-query.xml \
--user <email>:<password> \
http://<davmailurl>:60080/users/<email>/contacts/</email></davmailurl></password></email>
In the response XML sent by Davmail, the previously created contact appears as:
<d:response>
<d:href>/users/<email>/contacts/T%20E%20S%26amp%3BT.vcf</email></d:href>
<d:propstat><d:prop><d:resourcetype>
<d:displayname>T E S&T.vcf</d:displayname>
</d:resourcetype></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat>
</d:response>
The D:displayname is not correctly encoded (should be & according to parser used, likely msxml6 here on my system) and the XML thus can not be parsed by a client application.
Arg, did not check with preview, 1 should be:
curl -v \
-T curl-vcard.txt \
-H "Content-Type: text/vcard; charset=utf-8" \
--request PUT \
--user (email):(password) \
http://(davmailurl):60080/users/(email)/contacts/T%20E%20S%26amp%3BT.vcf
and 3 (querying contacts) should be:
curl -v \
--request PROPFIND \
--header "Content-Type: application/xml; charset=utf-8" \
--header "Depth: 1" \
--data @curl-query.xml \
--user (email):(password) \
http://(davmailurl):60080/users/(email)/contacts/