View Issue Details

IDProjectCategoryView StatusLast Update
0001110SOGo Connectorwith external serverpublic2012-11-21 16:17
Reporterfedel Assigned To 
Status closedResolutionfixed 
Product Version3.104 
Target VersionFixed in Version 
Summary0001110: Various patches for synchronizing Thunderbird address books with iPhone, iPad etc. and DAViCal
DescriptionThought I'd share the results of my Sogo Thunderbird connector debugging exercises. I am running the latest Sogo connector (3.104 nightly 1/30/2011) on Thunderbird 3.1.7 with a DAViCal server version running on Debian. I am trying to synchronize my Thunderbird address books with all my iToys.

With the original Sogo connector from this did NOT work at all. Calendar syncing worked fine, but address book sync was broken all over the place. After hours of debugging I can now synchronize TB3 with my iToys.

The attached series of patches may be applied against the current Sogo connector nightly ( at the time of this submission). I'm assuming you know how to patch a Mozilla add-on.

All patches are individually explained in the "Additional Information" field.
Additional Information(1) sogo-connector-3.104-nightly-20110130-bugfix-sync-response.patch

The Sogo connector is unable to receive any updates from compliant DAV servers (except Sogo server :-)) because the Sogo connector expects deprecated DAV response tokens. For more details, see:

This patch lets the Sogo connector accept "response" tags in addition to "sync-response", thus removes the need for setting "use_old_sync_response_tag = true" in DAViCal.


(2) sogo-connector-3.104-nightly-20110130-ios-quirk-vcard-grouping.patch

Apple uses an optional grouping feature defined in RFC2426, chapter 3.1.2. For example, iOS sends content lines prefixed with "item1." as in

    item1.ADR;type=WORK;type=pref:;;1 Infinite Loop;Cupertino;CA;95014;USA

Unfortunately, the current Sogo connector does not understand this syntax. It only tries matching parameter names against the entire first field until ; and ignores any VCARD records with unknown parameter names.

Now, in real life this means that any contacts touched on an Apple toy will cause TB contacts without any addresses. Next time such a contact is modified in TB, this contact's address information will be gone forever. Sigh!

This patch lets the Sogo connector ignore the group prefix and luckily import addresses with or without group prefix.


(3) sogo-connector-3.104-nightly-20110130-ios-quirk-multiline-street.patch

Apple seems to incorrectly encode multi-line address values using line-feeds (instead of using COMMAs as defined in RFC2426). This patch makes the Sogo connector accept such misformed VCARDs by translating line feeds within address fields into COMMAs. Please note that this patch eventually concatenates multi-line addresses into comma separated single-line address fields which is not perfect but still better than loosing precious address data. It would have been better to cleanly fix Apple's VCARD writer but that seems out of reach.


(4) sogo-connector-3.104-nightly-20110130-bugfix-vcard-escape.patch

The Sogo connector does not seem to escape values correctly when encoding VCARDs (see RFC2426). For example, COMMAs are escaped twice, some line breaks are not escaped at all (e.g. in notes), commas in values allowing for comma separated lists (e.g. in ADR, NICKNAME...) were still escaped and so on. This patch tries correcting the escaping logic in the Sogo connector.


Instead of individually applying separate patches, you may also apply all patches at once by using sogo-connector-3.104-nightly-20110130-all.patches.
TagsNo tags attached.


related to 0001098 resolvedwsourdeau GroupDavSynchronizer: obsolete DAV:sync-response after DAV:sync-collection request? 


2011-01-31 11:04


sogo-connector-3.104-nightly-20110130-all.patches (Attachment missing)

2011-01-31 11:05


sogo-connector-3.104-nightly-20110130-bugfix-sync-response.patch (Attachment missing)

2011-01-31 11:05


sogo-connector-3.104-nightly-20110130-bugfix-vcard-escape.patch (Attachment missing)

2011-01-31 11:05


sogo-connector-3.104-nightly-20110130-ios-quirk-multiline-street.patch (Attachment missing)

2011-01-31 11:06


sogo-connector-3.104-nightly-20110130-ios-quirk-vcard-grouping.patch (Attachment missing)


2011-03-08 14:29

reporter   ~0002223

I am not familiar with patching, but the patches are that one i need to use my iphone address book.
Is there a place where to get the patched version or when will it be merged to the main sogo connector?


2011-03-08 15:16

viewer   ~0002227

Hi Tigono,

Don't worry. I am currently having a look at this bugreport. Most of the code should be integrated in the next nightlies...


2011-03-09 15:18

viewer   ~0002239

Issues 2 and 4 above are fixed. Please try the nightlies. The issue with webdav sync will be fixed later. I need yet to double-check issue 3.

Thanks for the patches!


2011-03-09 15:20

viewer   ~0002240

Further on webdav-sync: since it requires changes to the SOGo server, it's postponed as I want to do it cleanly. Thanks nonetheless.


2011-03-09 15:51

viewer   ~0002241

Issue 3 has been patched as well. So this bugreport is mostly fixed.
Tigono: if you wish, please use the new nightlies that I will regenerate in a few minutes...


2011-03-10 02:41

reporter   ~0002243

I tested (2) and what I saw it is fixed, this helps a lot :-)

But there is another new behavior in concern to Thunderbird (only using thunderbird, sogo connector and in this case apple address book server).
(1) Adding a contact works well!
(2) Deleting a contact works well!

=> Changing some properties of the contact does not update the contact anymore!
   I have to retest this, but I think it worked with pre4?! I don't know if this
   is in fact of the changes made above and I will make more tests in the
   afternoon. Only give you a short feedback fast ...


2011-03-10 23:50

reporter   ~0002248

After making some additional tests I see that changing contacts is not possible anymore with Thunderbird3.19, SoGo Connector Nightly Build and Apple Addressbook Server.

The Server gives the following error message:

2011-03-11 05:45:31+0100 [-] [carddav-8802] [-] [twistedcaldav.method.put_addressbook_common#error] Invalid vcard data: More than one VERSION property in component <Component: "<VCARD| [<VERSION{}3.0>, <VERSION{}3.0>, <PRODID{}-//Inverse inc.//SOGo Connector 1.0//EN>, <PRODID{}-//Inverse inc.//SOGo Connector 1.0//EN>, <UID{}C4B05D06-42E0-0001-A6CB-1900166319E7>, <ADR{u'TYPE': [u'work']}Ich weiss nicht 10\\nStadt, 33055>, <ADR{u'TYPE': [u'home']}Das ist eine Strasse 44\\n, >, <FN{}Dieter Wudel>, <N{} Dieter Wudel >, <X-MOZILLA-HTML{}FALSE>]>">
2011-03-11 05:45:31+0100 [-] [carddav-8801] [PooledMemCacheProtocol,client] [twistedcaldav.method.put_addressbook_common#error] Cannot overwrite vcard resource C4B0A621-5660-0001-B45B-66216B351A4C.vcf with different UID C4B0A621-56A0-0001-95D3-1E6F30406570

Please let me know if I should open a new bug?


2011-03-11 14:12

viewer   ~0002251

Hi Tigono,

No it's fine. I'll have a look right away. Thanks for reporting this!


2011-03-11 15:29

viewer   ~0002256

Hi Tigono,

That bug is now fixed. Please try again with the latest nightlies:


2011-03-12 01:45

reporter   ~0002257

Last edited: 2011-04-11 08:35

Hi, the first error message is gone but the second remains ->

[2011-03-12 07:30:22+0100 [-] [carddav-8801] [PooledMemCacheProtocol,client] [twistedcaldav.method.put_addressbook_common#error] Cannot overwrite vcard resource C4B0A621-5660-0001-B45B-66216B351A4C.vcf with different UID C4B0A621-56A0-0001-95D3-1E6F30406570

AND: It works like a charme in the pre4 version (but not with my iphone:-)

I hope this has no influence: the thunderbird version with pre4 is on a windows pc and the test producing the error is on a mac (only for information)

This has no influence, I tested it with Sogo Connector 3.105. Creating contacts in thunderbird works, but updating does not work anymore; no influence of the OS of the client found.



2012-11-21 16:17

administrator   ~0004964

From reading the comments, this bug seems fixed.

Issue History

Date Modified Username Field Change
2011-01-31 11:04 fedel New Issue
2011-01-31 11:04 fedel File Added: sogo-connector-3.104-nightly-20110130-all.patches
2011-01-31 11:05 fedel File Added: sogo-connector-3.104-nightly-20110130-bugfix-sync-response.patch
2011-01-31 11:05 fedel File Added: sogo-connector-3.104-nightly-20110130-bugfix-vcard-escape.patch
2011-01-31 11:05 fedel File Added: sogo-connector-3.104-nightly-20110130-ios-quirk-multiline-street.patch
2011-01-31 11:06 fedel File Added: sogo-connector-3.104-nightly-20110130-ios-quirk-vcard-grouping.patch
2011-03-08 14:29 tigono Note Added: 0002223
2011-03-08 15:16 wsourdeau Note Added: 0002227
2011-03-09 15:18 wsourdeau Note Added: 0002239
2011-03-09 15:19 wsourdeau Relationship added related to 0001098
2011-03-09 15:20 wsourdeau Note Added: 0002240
2011-03-09 15:51 wsourdeau Note Added: 0002241
2011-03-10 02:41 tigono Note Added: 0002243
2011-03-10 23:50 tigono Note Added: 0002248
2011-03-11 14:12 wsourdeau Note Added: 0002251
2011-03-11 15:29 wsourdeau Note Added: 0002256
2011-03-12 01:45 tigono Note Added: 0002257
2011-03-12 01:47 tigono Note Edited: 0002257
2011-04-11 08:35 tigono Note Edited: 0002257
2012-11-21 16:17 ludovic Note Added: 0004964
2012-11-21 16:17 ludovic Status new => closed
2012-11-21 16:17 ludovic Resolution open => fixed