views:

1118

answers:

6

Hi,

I have a rails application running on a Linux server. I would like to interact with Outlook/Exchange 2003 appointments from the rails application. For example, certain actions should trigger sending an appointment, and then preferably accepting/canceling the appointment in Outlook should trigger events in the application.

Failing this, is it possible to publish calendars that Outlook 2003 can read without requiring Outlook plugins? I note that Outlook 2003 does not support ical without plugins for example. Similarly, if this is not easily doable in Ruby, but is in another language (such as Perl for example) running on Linux then those suggestions would be welcome.

Any advice on how to achieve this, or where to start looking for answers would be gratefully received.

+5  A: 

Outlook appointments are just e-mails with special header information. There's some information in this tutorial on the required parts. I sent a few meeting invites from my Outlook to my Gmail account and took a look at the raw headers there - you can figure most of the protocol out from that.

The iCalendar specs may help you, as well.

ceejayoz
+1  A: 

Take a look at the project RExchange on github.

Thanatos
A: 

For accessing appointments, you can just access the Calendar folder on Exchange using WebDav. For creating appointments, please refer to RFC2445 for details.

Roman
A: 

Further to ceejayoz's comment, you can also use ActionMailer to catch the replies that are sent back, and act on them - you'll need some form of unique id in a place that will be included in the reply though.

Jon Wood
+1  A: 

Thanks for everyones help. I found something that showed me how to do this with Perl, and ported it over to ruby. I've blogged about it for those looking for a solution

Roland
A: 

If you can upgrade to Exchange 2007, you can use Exchange Web Services that is more powerful and convenient to use than WebDAV.

At work, I inherited a Rails app that allow users to create single appointments. I was asked to write code to link those appointments in the app to users' outlook calendars, so that they are always in sync. Sounds to me very similar to what you want to do.

I don't think I'm allowed to publish the exact code I wrote though. Anyway I'll give you a bit idea on how I addressed it.

Exchange Web Services only provide API in C# (no surprise, it's Microsoft. Technically, you can use other languages since it's actually SOAP.). I wrote a middleware in C# that does the sync between Exchange server and the Rails app. When users do scheduling in the app, changes are sent to the middleware so changes can be reflected to their outlook calendars. Meanwhile, the middleware registers Push Notification subscriptions for all users -- every time changes are made in Outlook, the middleware will be immediately notified, which in turn faithfully reflect those changes in the app as well. Of course, recurring appointments are also supported.

Hope that helps you.

Cygwin98