Menu

#598 DavMail generates invalid multistatus XML if .ics file is broken

v4.6.1
closed-wont-fix
nobody
None
5
2018-05-24
2015-06-08
No

If there is some invalid ICS file on the server, DavMail will generate invalid XML for PROPFIND requests sent. Concretely:

</D:response>
<D:response>
    <D:href>/users/dsantana@fnb.co.za/calendar/AAMkADFhNGYwNzJkLTE2YjEtNDA0ZC04YmQ2LWQ3YTdiOGYwY2Y2NABGAAAAAABWxfZAMOs7Q4UNDhZ5a505BwCqyWteSHs-RJcaDYcJcinrAAASxFepAAAlZPQvrhafTpQ54lmBac4TAAAE4kcaAAA%3D.EML</D:href>
    <D:propstat>
        <D:prop>
        <D:response>
            <D:href>/users/dsantana@fnb.co.za/calendar/isnjuf63v3fbv4phiad7iui8d8.ics</D:href>
            <D:propstat>
            <D:prop>
                <C:calendar-data xmlns:C="urn:ietf:params:xml:ns:caldav" C:content-type="text/calendar" C:version="2.0">[...]

Note that DavMail truncates the response content for the item AAMkA[...].ics.

For more information, please see https://github.com/untitaker/vdirsyncer/issues/214#issuecomment-109724122

Unfortunately I can't give you a step-by-step way to reproduce this issue because I'm unable to upload any broken ICS files to Exchange through DavMail.

Discussion

  • Markus Unterwaditzer

    Also the PROPFIND request we send looks like this:

    PROPFIND http://localhost:1080/users/dsantana@fnb.co.za/calendar/                                         
    Headers: {'Depth': 1, 'Content-Type': 'application/xml; charset=UTF-8', 'User-Agent': 'vdirsyncer'}                
    Body:
    <?xml version="1.0" encoding="utf-8" ?>
                <D:propfind xmlns:D="DAV:">
                    <D:prop>
                        <D:resourcetype/>
                        <D:getcontenttype/>
                        <D:getetag/>
                    </D:prop>
                </D:propfind>
    
     
  • jvstein

    jvstein - 2015-08-27

    I experienced the related duplicate problem with davmail and Thunderbird/Lightning over the course of the last year. I had several duplicate events, seemingly caused by events created by others being updated. I'm not sure if the problem lies in Lightning or davmail.

     
  • Patrice Mandin

    Patrice Mandin - 2016-03-31

    I also encounter this problem with invalid characters, in my case an invalid timezone returned by an Exchange server:
    (I replaced 0x00 characters by [NUL])
    TZID:Paris, Madrid[NUL]2[NUL][NUL][NUL][NUL][NUL][NUL][NUL][NUL][NUL]
    and this timezone is then copied to DTSTART and DTEND for the event, breaking the later generated XML

     
  • Markus Unterwaditzer

    I see, so this behavior may be caused by NUL-characters in the response by Exchange? Interesting...

     
  • Mickael Guessant

    • status: open --> pending-wont-fix
     
  • Mickael Guessant

    Well, looks like the best answer is to fix broken events on the server with:
    https://www.microsoft.com/en-us/download/details.aspx?id=28786

    Feel free to provide a better workaround on DavMail side :-)

     
  • Markus Unterwaditzer

    I do think that DavMail's behavior in this case (generating syntactically invalid XML) is not acceptable. Even a Internal Server Error would be better.

     
  • Mickael Guessant

    Indeed, the issue is that I don't reproduce this behaviour here, and there are already many controls in the ICS parser => without more details I don't have enough info to improve current code.

     
  • Markus Unterwaditzer

    Fair enough.

     
  • Mickael Guessant

    • status: pending-wont-fix --> closed-wont-fix
     

Log in to post a comment.