Friday, February 22, 2008

Questing for the Holy Grail (Of Calendar syncronization)

I have successfully completed a proof of concept script in python, which connects via IMAP/SSL to an IMAP enabled Microsoft Exchange server. It IS possible to pull Exchange calendar entries through IMAP, once stripping off some of the MS style fat from the returned data, we have what is more or less iCal (RFC2445) data.

The number one Google term for python iCal is an old module written by "mxm". This was parsing the dates wrong, and it seems like Microsoft has done a strangely good job with implementing the standard and the module is actually doing some highly unnecessary mangling of the string. I'm still working on my own script but will eventually fix this and try to merge the fix back upstream.

I also uncovered a nasty glitch in Microsoft's implementation of the standard, and they were doing so well. Though probably not strictly a problem, Google's API isn't forgiving enough to let the deviation slide. According to the LETTER of the iCal RFC Recurrence rules which specify weekly recurrences on specific days of the week are allowed to have multiple values separated by a comma. EX: BYDAY=Tu,Th,Su for Tuesday, Thursday and Sunday. Google takes this literally in the sense that there can be ONLY a comma between days. Microsoft has been a bit more liberal with its implementation and places a single space after the comma. Google sees it and vomits out the wonderfully descriptive "Bad Request" error. No wonder it took me around 5 hours to track it down.

Now, as much as I love standards, throwing a hissy fit over something like this is a little much. I have recorded this as an issue with the Google Data API. It is here:
http://code.google.com/p/gdata-issues/issues/detail?id=371

That being said I have managed to work past these issues and have a pseudo working script to sync from IMAP enabled Exchange to Google calendar. It is not ready for public consumption yet but can be made available on a case by case basis until it is to anyone who asks.

For those of us who live by the Exchange calendar...
Coming soon: New and improved Google Calendar! (Now with useful!)

--PXA, OUT!

3 comments:

Paul D. Eden said...

Any word on the implementation? Is it ready to share yet?

Sloloem said...
This comment has been removed by the author.
Sloloem said...

I had a few hangups and had to switch from IMAP to WebDAV, that ate some time. Exchange to Google is working pretty smoothly, and I have the rest of the script thought out, I just need to sit down and code it. RIT is on break until 1/5/2009, I hope to have some major progress done by that. Maybe even a working Google to Exchange proof of concept.