Giter VIP home page Giter VIP logo

Comments (9)

christian-putzke avatar christian-putzke commented on July 21, 2024

I'll have a closer look at the issue this evening

from roundcube-carddav.

tonytone avatar tonytone commented on July 21, 2024

Thanks a lot in the meantime I've updated the davmail gateway to the latest version 3.9.6 build 1843, however issue remains.

from roundcube-carddav.

christian-putzke avatar christian-putzke commented on July 21, 2024

I'm not sure why davmail throws a null pointer exception but it seems that davmail has a different handling for the CardDAV-XML-Requests. I've never tested my CardDAV-PHP-Client with davmail but for memotoo, apple addressbook server and sabreDAV I had to make a view changes. Maybe you can provide me a test account on your server so that I can try to figure out the error directly.

from roundcube-carddav.

tonytone avatar tonytone commented on July 21, 2024

Well theres a big difference in the propfind request send by CardDAV-PHP as opposed to AddressBook. The nullpointer in davmail suggests davmail expects an xml but does not receive any. This would be correct since the carddav-php request doesnt have any body. Is this intended carddav-php behavior or could something be breaking resulting in a partial request? I tried to figure out where and how this request is build up in cardav-php but wasn't able to.

Unfortunately I am unable to provide access to our network although that would have probably made this a lot easier. But hopefully my findings can point you in the right direction?

< PROPFIND /users/user@domain/contacts/ HTTP/1.1
< User-Agent: CardDAV-PHP/0.4.4
< Host: dev.domain:1080
< Accept: */*

< PROPFIND /principals/users/user%40domain/ HTTP/1.1
< Host: dev.domain:1080
< User-Agent: AddressBook/6.1 (1062) CardDAVPlugin/196 CFNetwork/520.2.5 Mac_OS_X/10.7.2 (11C74)
< Content-Length: 439
< Accept: */*
< Accept-Language: en-us
< Accept-Encoding: gzip, deflate
< Content-Type: text/xml
< Depth: 0
< Connection: keep-alive
< <?xml version="1.0" encoding="UTF-8"?> <A:propfind xmlns:A="DAV:"> <A:prop> <B:addressbook-home-set xmlns:B="urn:ietf:params:xml:ns:carddav"/> <B:directory-gateway xmlns:B="urn:ietf:params:xml:ns:carddav"/> <A:displayname/> <C:email-address-set xmlns:C="http://calendarserver.org/ns/"/> <A:principal-collection-set/> <A:principal-URL/> <A:resource-id/> <A:supported-report-set/> </A:prop> </A:propfind>

from roundcube-carddav.

tonytone avatar tonytone commented on July 21, 2024

ok i think i've figured it out somewhat but im still having problems getting that solution implemented as I am not familiar with this level op coding. The fallowing xml should be send alongside the first propfind to get the servers properties;
<A:propfind xmlns:A="DAV:"> <A:prop> <B:addressbook-home-set xmlns:B="urn:ietf:params:xml:ns:carddav"/> <B:directory-gateway xmlns:B="urn:ietf:params:xml:ns:carddav"/> <A:displayname/> <C:email-address-set xmlns:C="http://calendarserver.org/ns/"/> <A:principal-collection-set/> <A:principal-URL/> <A:resource-id/> <A:supported-report-set/> </A:prop> </A:propfind>

Then (from what i understand from the code) after the server was added to the database the first sync should be performed by means of a second propfind request containing the fallowing xml and search header;
<?xml version="1.0" encoding="UTF-8"?> <A:propfind xmlns:A="DAV:"> <A:prop> <A:add-member/> <D:bulk-requests xmlns:D="http://me.com/_namespace/"/> <A:current-user-privilege-set/> <A:displayname/> <B:max-image-size xmlns:B="urn:ietf:params:xml:ns:carddav"/> <B:max-resource-size xmlns:B="urn:ietf:params:xml:ns:carddav"/> <C:me-card xmlns:C="http://calendarserver.org/ns/"/> <A:owner/> <C:push-transports xmlns:C="http://calendarserver.org/ns/"/> <C:pushkey xmlns:C="http://calendarserver.org/ns/"/> <A:quota-available-bytes/> <A:quota-used-bytes/> <A:resource-id/> <A:resourcetype/> <A:supported-report-set/> <A:sync-token/> </A:prop> </A:propfind>

Search: SELECT "http://schemas.microsoft.com/exchange/permanenturl","DAV:getetag","urn:schemas:httpmail:subject","http://schemas.microsoft.com/mapi/proptag/x10f3001f","urn:schemas:calendar:instancetype","DAV:displayname" FROM SCOPE('Shallow TRAVERSAL OF "/exchange/user@domain/Contacts"') WHERE ("http://schemas.microsoft.com/exchange/outlookmessageclass" = 'IPM.Contact' And "DAV:isfolder" = false And "DAV:ishidden" = false And "http://schemas.microsoft.com/exchange/outlookmessageclass" = 'IPM.Contact')

I've tried hacking in the first xml which proved my ideas about the initial nullpointer and this resulted in exactly the same response as was given to AddressBook;
<?xml version="1.0" encoding="UTF-8"?> <D:multistatus xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav" xmlns:E="urn:ietf:params:xml:ns:carddav"> <D:response> <D:href>/principals/users/<user>@<domain></D:href> <D:propstat> <D:prop> <E:addressbook-home-set> <D:href>/users/<user>@<domain>/contacts/</D:href> </E:addressbook-home-set> <D:displayname><user>@<domain></D:displayname> <D:supported-report-set> <D:supported-report><D:report><C:calendar-multiget/></D:report></D:supported-report></D:supported-report-set></D:prop><D:status>HTTP/1.1 200 OK</D:status></D:propstat></D:response></D:multistatus>

However i hard-coded it in the get() inside the carddav_backend.php and this is offcourse not the correct spot for it in your source. Would you be willing to help me implement these changes?

from roundcube-carddav.

christian-putzke avatar christian-putzke commented on July 21, 2024

I'll help you as much as I can to implement the changes in my plugin. But at the moment I haven't much time. I'm sorry. Let me know if you get any further results.

from roundcube-carddav.

tonytone avatar tonytone commented on July 21, 2024

Well ive implemented some changes so I am receiving the contacts from DAVMail now. However now that the contacts are in the database I noticed a few other problems;

  • Autocomplete only returns the label of the carddav addressbook and not the contacts themselves. It seems that the get_search_set() function generates the search filter for the query like A) in stead of a proper AND bla like bla OR bla like bla.

[08-Dec-2011 17:57:13] MDB2 Error: syntax error (-2): _doQuery: [Error message: Could not execute statement] [Last executed query: SELECT * FROM carddav_contacts WHERE user_id = '1' A) ORDER BY name ASC ] [Native code: 1064] [Native message: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'A) ORDER BY name ASC' at line 7]

  • Search does not return any carddav results at all
    Same as above
  • Syncing does not seem to work either
    Havent looked into this yet
  • Changing the addressbooks label results in an error
    Havent looked into this yet
  • If contacts have no firstname lastname or email set then no label is displayed in the contactlist (in this case I would like to display the Company name)
    More of a wish then a bug I guess

I also had to make minor changes to rcube_vcard.php to make cellnumber and aniversary show op correctly, nickname however, doesnt seem to be present in the the database vcard even though it does have a value.

Al the functionalities named above that are applicable to an LDAP addressbook as well, work fine for LDAP addressbooks, except maybe the last one which could be in addressbook's logic rather than your plugin. I understand that you are busy, so ill keep fiddling around untill i get at least these basic functionalities to work properly. But if you have some pointers as to where in your source i could find the code that relates to those functionalities that would be a big help, because to be honest, even though theres some progress, im in WAY over my head here hehe.

from roundcube-carddav.

christian-putzke avatar christian-putzke commented on July 21, 2024

Thanks for the huge report!

  1. For me the autocomplete works fine with all contacts from two different CardDAV-Sources. Which version are you using?
  2. Same as 1. works fine for me
  3. Can't say anything about this. But if the first initial import for the CardDAV-Contacts work, the sync should work as well
  4. The adressbooks label can't be changed. I've never implemented such a function ;)
  5. The label for contacts displayed in the addressbook depends on roundcoube. I'll just use the internal hooks to display the CardDAV-Contacts so you should report that issue on roundcube.net
  6. If you change something in the original roundcube source like the rcube_vcard.php you should send your changes also to the roundcube developers itself

Best regards,
Christian

from roundcube-carddav.

christian-putzke avatar christian-putzke commented on July 21, 2024

No response since 2 months -> close

from roundcube-carddav.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.