View Issue Details

IDProjectCategoryView StatusLast Update
0002547SOGo Connectorwith external serverpublic2016-07-21 20:11
ReporterSven Giermann Assigned Toludovic  
PrioritynormalSeverityfeatureReproducibilityalways
Status closedResolutionsuspended 
Product VersionMonotone / nightly 
Summary0002547: SOGo Connector should also handle CardDAV responses with additional header lines before "BEGIN:VCARD"
Description

After applying the patch so solve the problems reported in Bug 1411, I finally came back to productive use of SOGo Connector CardDAV address book against my Kerio Connect server...

There's only one change still needed to get it work with Kerio Connect:
When reading the response of a request to Kerio, the server adds some header lines prepending the "BEGIN:VCARD" contents.
Unfortunatly the Connector checks, whether the response starts with "begin:vcard" and fails in this case.

The attached patch will simply change this logic to look for the first occurence of "begin:vcard" in the response and to use this to import the VCARD or VLIST. It hopefully does not interfere with any product other than Kerio Connect ;)

TagsNo tags attached.

Activities

Sven Giermann

Sven Giermann

2013-12-13 08:55

reporter  

skip_headers.diff (1,349 bytes)   
--- chrome/content/sogo-connector/general/sync.addressbook.groupdav.js	Fr 22. Nov 21:31:04 2013
+++ chrome/content/sogo-connector/general/sync.addressbook.groupdav.js	Mo  9. Dez 16:32:08 2013
@@ -369,8 +369,9 @@
         this.progressMgr.updateAddressBook(this.gURL);
         if (Components.isSuccessCode(status)
             && data
-            && (data.toLowerCase().indexOf("begin:vcard") == 0))
-            this.importCard(key, data);
+            && (data.toLowerCase().indexOf("begin:vcard") >= 0))
+            // strip content (i.e. header lines) before "BEGIN:VCARD",
+            this.importCard(key, data.substring(data.toLowerCase().indexOf("begin:vcard")));
         else
             this.appendFailure(status, key);
 
@@ -385,8 +386,9 @@
         this.progressMgr.updateAddressBook(this.gURL);
         if (Components.isSuccessCode(status)
             && data
-            && (data.toLowerCase().indexOf("begin:vlist") == 0))
-            this.importList(key, data);
+            && (data.toLowerCase().indexOf("begin:vlist") >= 0))
+            // strip content (i.e. header lines) before "BEGIN:VCARD",
+            this.importList(key, data.substring(data.toLowerCase().indexOf("begin:vlist")));
         else
             this.appendFailure(status, key);
         if (this.remainingDownloads == 0) {
skip_headers.diff (1,349 bytes)   
Sven Giermann

Sven Giermann

2013-12-13 08:56

reporter   ~0006358

Is there any chance to get this and the patch in Bug 1411 integrated to the next version of SOGo Connector?
This would save me from patching it mayself in every new version...

agattig

agattig

2014-12-17 14:34

reporter   ~0007864

Hello Sven,

we want to use Kerrio Connect 8.4 and Thunderbird (24.8.1) with the SOGo Connector (24.0.7).

I found your diff and patched it, but it don´t work

(debug thunderbird log:
*** new sync: 1
1/sync with https://192.168.10.209/carddav/users/domain.de/agattig/...
GOT STATUS: 207
1/sync with https://192.168.10.209/carddav/users/domain.de/agattig/ has ended.

server 'https://192.168.10.209/carddav/users/domain.de/agattig/' is not a valid groupdav collection***)

Hope you have a solution.

Many thanks

Sven Giermann

Sven Giermann

2014-12-18 08:06

reporter   ~0007872

It was hard to find the correct URL to sync against Kerio, but mine is working for months now:

https://<server>/contacts/<domain>.de/<user>/addressbook/

agattig

agattig

2014-12-18 08:53

reporter   ~0007873

Many many thanks Sven. It works!!! :)

have you a correct url for the global public adressbook?

Original from Kerio KB:

For public contacts
HTTP(S)://mail.example.com/carddav/users/example.com/.public

Sven Giermann

Sven Giermann

2014-12-18 10:50

reporter   ~0007877

I found the following working in the past:
https://<server>/public-contacts/<domain>.de/addressbook/

But you will have MANY contacts in there, since it lists all public contacts that are allowed to read in one directory. I cannot tell, where new contacts will be written to, but it might be worth trying...

I personally only write to my personal addressbook and use the public as read-only LDAP (Base DN: fn=ContactRoot )
But I didn't find a working URL for a specific public addressbook residing in "Public folders" to have someone writing new contacts there. Feel free to post your results, when you've found one... :)

agattig

agattig

2014-12-18 14:35

reporter   ~0007881

Big Thank you Sven, you solved all my problems.

i tested the last 2 days and i got only errors. but your solution is perfect and it works!

Quick Test with the public-contacts - it do all what we want :)

specific public addressbook we don´t use at the moment.

I wish you a happy Christmas.

ludovic

ludovic

2016-07-21 20:11

administrator   ~0010514

Fixed in commit 5c312ac5

Issue History

Date Modified Username Field Change
2013-12-13 08:55 Sven Giermann New Issue
2013-12-13 08:55 Sven Giermann File Added: skip_headers.diff
2013-12-13 08:56 Sven Giermann Note Added: 0006358
2014-12-17 14:34 agattig Note Added: 0007864
2014-12-18 08:06 Sven Giermann Note Added: 0007872
2014-12-18 08:53 agattig Note Added: 0007873
2014-12-18 10:50 Sven Giermann Note Added: 0007877
2014-12-18 14:35 agattig Note Added: 0007881
2016-07-12 12:05 ludovic Status new => assigned
2016-07-12 12:05 ludovic Assigned To => ludovic
2016-07-21 20:11 ludovic Note Added: 0010514
2016-07-21 20:11 ludovic Status assigned => closed
2016-07-21 20:11 ludovic Resolution open => suspended