dupondje / PHP-Push-2

Z-Push Fork With CalDAV/LDAP Support
GNU Affero General Public License v3.0
67 stars 24 forks source link

Can't get carddev to work #78

Closed maevelevie closed 8 years ago

maevelevie commented 11 years ago

First, great library - just what I was looking for! I have setup SOGo and I'm trying to get it to sync with my HTC One. My calendar and mail are syncing correctly. However, my contacts remain empty. This is my configuration:

define('BACKEND_PROVIDER', "BackendCombined");
(...)
define('CALDAV_SERVER', 'https://<myserver>'); // working correctly
define('CALDAV_PORT', '443');
define('CALDAV_PATH', '/SOGo/dav/%u/Calendar/');
define('CALDAV_PERSONAL', 'personal');

define('CARDDAV_SERVER', 'https://<myserver>'); // not working
define('CARDDAV_PORT', '443');
define('CARDDAV_PATH', '/SOGo/dav/%u/Contacts/');
define('CARDDAV_PRINCIPAL', 'personal');
define('CARDDAV_PERSONAL', 'personal');

In the log I'm seeing this:

BackendCardDAV->Logon('https://<<myserver>>:443/SOGo/dav/<<myuser>>/Contacts/')
BackendCardDAV->Logon(): User '<<myuser>>' is authenticated on CardDAV
BackendCardDAV->GetFolderList(): Getting all folders.
BackendCardDAV->StatFolder('personal')
BackendCardDAV->GetFolder('personal')
BackendCardDAV->StatFolder(Abook Id [personal] Abook Name [CardDAV AddressBook])

...and that's it. No sync is actually taking place and since I don't see any other function calls, I wonder if the script is actually retrieving the contacts from SOGo. The folder contains about 600 contacts, which are showing up correctly in the SOGo web version and in Thunderbird. Do you have any idea why the sync might not be working?

maxwellworthington commented 11 years ago

I am having this same problem. Mail and Calendars work fine, but Contacts list is empty. I have even used the demo configurations to connect to inverse server and receive the same result. My settings and logs are nearly identical to what you are reporting.

I find it interesting that cal dav searches for all calendars under the path and shows each calendar by name, but card dav returns one addressbok titled "CardDAV AddressBook". Is that the correct and expected behavior?

Also, it looks like we are both confused by CALDAV_PERSONAL vs. CARDDAV_PRINCIPAL. Could the developers explain why these are not consistent for card and cal dav?

Here are my log files: http://mail.maxworth.org/push.log

Ruud68 commented 10 years ago

Hi, just 'stumbled' upon this project! Super! I'm using SOGo for some time now and want to get rid of funambol to sync calendar and contact with my andtoid devices. Used this project, got Calendar to sync, but no success on the contacts part: nothing happens. Saw already some posts from other people who couldn't get it to work and saw a very old post stating that it is not implemented (?) Just to bump this topic: does anybody have contact sync working, if so what are your respective settings in config.php? thanks in advance, Ruud.

mmerlone commented 10 years ago

For contacts to work you have to edit backend/carddav/config.php like this:

define('CARDDAV_PROTOCOL', 'http'); define('CARDDAV_SERVER', 'sogo.domain.tld'); define('CARDDAV_PORT', '80'); define('CARDDAV_PATH', '/SOGo/dav/%u/Contacts/personal/'); define('CARDDAV_CONTACTS_FOLDER_NAME', ''); define('CARDDAV_SUPPORTS_SYNC', false);

Adjust "sogo.domain.tld" to your SOGo server.

Ruud68 commented 10 years ago

Hi, thanks for your quick reply. I do not have the file you referred to :( did you create it yourself, it is not in this package? tried 'porting' these setting to the z-push/config.php file but this 'breaks' the configuration (have to comment out the carddav_protocol because otherwise I am not able to login).

Any other tips /pointers? thanks, Ruud

fmbiete commented 10 years ago

I think that @mmerlone is using a repo based in Z-Push 2.1.x and @Ruud68 is using another one based in Z-Push 2.0.x

Folder structure is not the same.

Regards,

Ruud68 commented 10 years ago

I'm using this one: https://github.com/dupondje/PHP-Push-2 bases on 2.0.7 as far as I can see

mmerlone commented 10 years ago

Oops, indeed. My bad, sorry. :)