Menu

#628 DavMail CalDAV adds METHOD-property to iCalendar objects

v3.6.5
closed-fixed
nobody
5
2018-05-15
2016-09-24
No

The iCalendar objects returned by DavMail's CalDAV server contain METHOD-properties, in our case METHOD:PUBLISH. Those are semantically invalid in the context of CalDAV, see Section 4.1 of RFC 4791:

Calendar object resources contained in calendar collections MUST NOT specify the iCalendar METHOD property.

This little detail actually has practical consequences, as servers like SabreDAV actually reject iCalendar objects with a METHOD property. See https://github.com/pimutils/vdirsyncer/issues/502 for the full background.

Discussion

  • Markus Unterwaditzer

    When I grep the sourcecode of DavMail, it appears that this property may have been added by Exchange, but DavMail has extra code to insert that property if it is missing: https://sourceforge.net/p/davmail/code/HEAD/tree/trunk/src/java/davmail/exchange/VCalendar.java#l155 I seriously wonder what is going on here. Is this code there to adapt to the requirements imposed by Exchange?

     
  • Mickael Guessant

    Indeed, the METHOD property was required by Exchange, and at some point the iPhone implementation stopped sending it => We now force it in DavMail code.

    Interestingly trying to troubleshoot your issue I found this discussion:
    event with METHOD not accepted by OC -- but it's RFC compliant! (CalDAV)
    https://github.com/owncloud/apps/issues/569

    Note tha METHOD: PUBLISH is in:
    iCalendar Transport-Independent Interoperability Protocol (iTIP) December 2009
    https://tools.ietf.org/html/rfc5546#section-3.2.1

    But not in:
    Scheduling Extensions to CalDAV June 2012
    https://tools.ietf.org/html/rfc6638

    SabreDAV decided to be strictly compliant to RFC... just have to decide which one.

    We try to follow the robustness principle:

    be conservative in what you do, be liberal in what you accept from others.
    https://en.wikipedia.org/wiki/Robustness_principle

     
  • Markus Unterwaditzer

    DavMail is not exposing those methods as part of the API defined by "Scheduling Extensions to CalDAV" or the API exposed by iTIP, but rather during normal usage of the core CalDAV API. This is the only API that concerns me and this is also the API where SabreDAV refuses METHOD:PUBLISH during upload.

     
  • Mickael Guessant

    Thanks for your feedback, you could try to remove METHOD from all events sent from the server, at it seems all other Caldav clients don't care about this property:

    In VCalendar.fixVCalendar:

    if (fromServer && "PUBLISH".equals(getPropertyValue("METHOD"))) {
        removeProperty("METHOD");
    }
    
     

    Last edit: Mickael Guessant 2016-12-24
  • Markus Unterwaditzer

    That would work for me, however, I don't think the second conditional "PUBLISH".equals(getPropertyValue("METHOD")) is necessary. There is no situation where it would be valid for the server to return the METHOD property.

    Could you apply this patch (or something like it) to DavMail?

     
  • Mickael Guessant

    The same code is used to retrieve ITIP messages from inbox => we have to accept METHOD property in this case.

    Fix available in subversion

     
  • Mickael Guessant

    • status: open --> closed-fixed
     
  • Mickael Guessant

    Fixed a while ago

     

Log in to post a comment.

MongoDB Logo MongoDB