Tag Archives: webdav exchange owa

OWA/Exchange WebDAV Doesn’t Support Infinite Recurrence

You may think you have an infinitely recurring appointment, but you’re wrong. It turns out that when working with Exchange via WebDAV, infinite recurrence is actually cut off at an arbitrary point far in the future. This applies to accessing Exchange directly with WebDAV or by using Outlook Web Access, which is based on WebDAV.

First, a little background. For those of you who aren’t aware, when you access data via WebDAV on Exchange, calendar data is actually rendered as RFC 2445 iCalendar data. The iCalendar data has a lot of extra x-name stuff that is specific to Microsoft that allows it to support the additional MAPI information that’s needed for additional properties (that’s OK, RFC 2445 allows it). Anyway, Microsoft also provides a WebDAV-SQL dialect to query the data (not just for iCalendar stuff). This is great, because it lets you offload a lot of your effort for searching through the data on to the Exchange server.

Where things get a bit interested is when you are working with infinitely recurring appointments (recurring appointments without an end date). Internally, iCalendar is fine with this. The infinite pattern can be represented by a single iCalendar event, and everything is good. The twist is that when you search for events for a specific date range, Exchange will give you the parent event that actually represents the infinitely recurring pattern and a single event for each instance of your pattern that falls between your search date range. The single events list themselves as instances via a special property.

The reason for this behavior is most likely OWA. OWA is basically an early implementation of AJAX that has client side Javascript accessing a WebDAV back end. By instantiating all instances of the recurring pattern for you, much work is taken off of the front end for computing when instances of the recurring pattern should go. OWA just queries for a date range that’s either a day, week or month, and it’s given everything it needs. Exchange is even smart, in that once it has received a query for a certain date range, it caches the instance events on the back end and they become visible via WebDAV as separate entities.

The intelligent reader will notice an opportunity for problems here: if Exchange is instanciating and caching all these instances on the fly, a request with an open-ended date range search will never complete. Exchange would just keep instancing more an more instances. To avoid this problem, Microsoft implemented a system where you can only query a bounded date range of up to 2 years. Once you have queried for a specific date range and the results have been cached, open-ended range queries will return already cached instances, but for places where nothing was previously cached, nothing will be returned. Learned that gotcha the hard way.

The second problem with this caching strategy is that if unchecked, it would allow a client of intentionally or otherwise perform a DOS attack on Exchange. A client could continue to query 2 year date ranges forever, and force Exchange to cache more and more instances. To avoid this, Microsoft has implemented a cap as to how far into the future it will allow you to go. From what I can tell, this isn’t documented anywhere, but this is what I have determined experimentally on Exchange 2003:

  1. Instances of infinite recurring appointments only seem to expand up until (approx) 10 year after the first date of the recurring meeting. This might actually not be time based, but rather # of occurrences based. I used an infinitely recurring appointment daily and it was about 10 or 11 years.
  2. Instances of finite recurring appointment expand arbitrarily to the future, until the end of the prescribed recurrence patter (I only tested this with recurrence patters that have a specified number of recurrences, namely recurring monthly for 999 times, I did not test this with a set end date).
  3. OWA suffers from the same limitation. If you try to view an appointment 30 years out for a daily infinite recurrence, it doesn’t show up.

The net result of this is that OWA will show an infinitely recurring appointment stopping sometime in the future, and your WebDAV queries might not return what you expect.