kristapsdz / kcaldav

a simple, safe, and minimal CalDAV server

Home Page:https://kristaps.bsd.lv/kcaldav

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

iCalendar RRULE parser does not adhere to RFC 5545 subclause 3.3.10

mhesseli opened this issue · comments

I'd like to sincerely thank you for this wonderful project. kcaldav is easy to install (especially via the OpenBSD ports system), and easy to set up and run.

The kcaldav 0.1.7 iCalendar parser does not seem to fully adhere to RFC 5545 subclause 3.3.10: Support for negative values for any of the rule parts that according to subclause 3.3.10 can be set to a negative value is missing. One example where the kcaldav 0.1.7 iCalendar parser deviates from RFC 5545 is handling of the BYSETPOS rule part: The parser limits the valid values to 1 to 366, but RFC 5545 states that the "valid values are 1 to 366 or -366 to -1".

RFC 5545 subclause 3.3.10 provides the following example of how a negative BYSETPOS value can be used to represent "the last work day of the month":

FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-1

Due to lack of support for negative BYSETPOS values, the above results in a parse error preventing iCalendar events containing recurrence rules such as the above from being accepted by kcaldav.