More on Exchange & OS X

·

Some of you might remember my calendaring experiment that happened almost one year ago. Well, there’s some news from that front, despite the fact I decided to abandon it.

  1. First, the bad news: No, there’s no real two-way sync between iCal and Exchange. Yet.2. Second, the bad news: I got degraded from an Exchange 2003 Server to an Exchange 2000 Server, which is bad, because I can’t issue WebDAV SEARCH queries anymore.3. Third, the bad news: Every time I dump the Calendar with a PROPFIND request, I download some 6MB of Calendaring data.1

And the good news? Well, there’s some, too.

  • My new employer does work with SSL, which means I don’t have to open the VPN everytime I want to do some testing.
  • I found some great code to access the OS X Keychain, so there’s a way to keep my passwords out of the code._ I found some iCalendar Python class I can use to access & compare (!) iCalendar events. *Mhm, yummy!** I’m pretty confident I can finish a working example of that kid *before* Apple releases Tiger. (Which, as it seems, does not really do iCal Exchange sync.)

Well, there’s still some more bad news to add. Exchange migration is planned to be finished later in 2005. And I still regularly fall back on my posts when I search for more information on this topic on Google. (However, I also found a great example on ASPN, which is first here :))

Google-Python

But now to some of the tidbits of the above list:

The Exchange Server#

I got to know that somehow, Microsoft crippled their Exchange Server before version 2003 XP1 in a way that it won’t work. More specifically: The examples on MSDN that show how a WebDAV SEARCH request is issued won’t work in Python or elsewhere, with the exception of Microsoft’s Windows-only XmlHttp Active X object.

Apparently, Service Pack 1 for Exchange 2003 fixes this, so there’s hope.

The PROPFIND#

PROPFIND is a WebDAV extension to HTTP requests. It allows one to dump all or specific properties of all elements in a WebDAV store. The good news here is, I can get all the data I want. The bad news is: I can’t filter it server-side, which means a 6MB dump each time I get the Calendar events!

I might get that down to 3MB or so, by carefully choosing the properties I really need, and do some filtering on the last changed date elsewhere, so there’s hope as well.

The Keychain#

One of the greatest things so far is the discovery of the [Keychain Framework][] on SourceForge. Thanks bdash for the link and the code example.

With the help of this Framework and PyObjC, you can really easily access the Keychain, create new entries and–more important–fetch passwords for existing entries! Whew!

Some sample code looks like this:

import objc,
new def getPassword( aService, anAccount = '' ):
    """Will get the password for aService/anAccount from the Keychain"""

    Keychain = new.module('Keychain')
    objc.loadBundle('Keychain', Keychain.**dict**, bundle*path='/Library/Frameworks/Keychain.framework')
    defaultKeychain = Keychain.Keychain.defaultKeychain()
    return defaultKeychain

passwordForInternetServer_forAccount_port_path_inSecurityDomain_protocol_auth*( aService, anAccount, 0, '', '', 0, 0 )

Pay close attention to the trailing “_” at the end of every function name! Yes, I got caught here in the first place!

Anyway, this is a real helper and I’m thinking of some other frameworks I could use …

The iCal.py#

Last, but not least, I found iCal.py, a little helper class that loads and interprets iCalendar files. It’s far from complete but a very good start, indeed–and it saves me from learning Ruby. ;)

The Outlook#

So, where have I gone since the post in January? Not so far by some means–but a lot if you understand what progress I made with respect to some of the points outlined above. I feel much more confident to actually come up with a solution that works!



  1. I might eventually cut them by some good amount, once I know what properties I really need. ↩︎

Comments.

No comments. Be the first to add one!
Add a comment.
We'll never share your email with anyone else. We use the Gravatar system to pull in pictures based on an anonymous hash.
Once you submit your comment, it will be moderated and then show up here shortly after.