Unsubtle geekery: CalDAV and Lightning

Recently I was trying to migrate from a Google Calendar and iCal/Sunbird to a Kerio Connect CalDAV server with multiple calendars and iCal / (Thunderbird & Lightning.) I ran into a bug that has existed for 7 years and 5 days, as of today.

Apparently the CalDAV specification outlines essentially a per-domain authentication instead of per-user. So when you add multiple calendars to Lightning all calendars from the same domain use the same login as the first time it was entered. The second (and 3rd, 4th, etc) calendars will fail to load because Lightning is providing only the user1@example.com password for all calendar.example.com calendars, including user2, user3, etc.

The solution is to step outside of Lightning and configure delegation so the user1 has access to the calendars of user2, user3, and so on. I used iCal to add each account and then added the two primary users to all 5 of the calendars available. Write access must be granted, otherwise as of Lightning 1.0b2 it will fail.

Side note, I’m not entirely sure it’s necessary but in order to lookup users to delegate to at least according to the manual, in Kerio Connect 7.2 you must use the auto setup utility (for the main account. and possibly for Address Book as well?) I could be wrong on that but I think I remember trying under the manual config and the auto-complete did not work.

After configuring delegation in iCal add the primary user first and then all of the other accounts – it will now work as it should have in the first place. Hope this helps some random internet searcher! (I’ll never know since spammers essentially made me turn off all user registration.)

Kerio CalDAV and CardDAV setup tips

This is a quick reference guide to configuring Kerio Connect 7.2 with a 10.6.7 machine + an iPhone.

CalDAV for iCal 4.0.4:
username user@server.example.com
server

CalDAV for Lightning 1.0b2:
username user@server.example.com
server

CardDAV for Address Book
username user(server.example.com)
Yes the server is in parentheses.

server address
Check the port in your admin page.

Configuring CardDAV within the iPhone will not work. You must use the iPhone Configuration Utility. If you’re savvy enough to have configured your own services so far this utility is a breeze to use. Fire it up, go to Configuration Profiles and fill out the General and CardDAV sections. In case you’re pulling from two different servers or with two (or more) different usernames, it’s easy to add multiple sets of settings. After you’re done, connect your phone and click the install button.

I am kind of stunned at how well this is working compared to all other Calendar and Contact syncing apps I’ve used. I used to have to wait for Google Calendar to finish writing (over the network) on my phone or I’d lose data, and every form of contact syncing other than the paid mobileme service has lost contact data including phone numbers, custom labels, etc. Syncing via iTunes with Google Contacts periodically duplicates some contacts. Syncing contacts using exchange is a nightmare, it dumps all custom labels and all but ~3 of the phone numbers per contact.

This solution not only maintains my contact entries perfectly but also syncs over the air. When inputting calendar data on my phone – which I do constantly – I don’t have to wait for network operations to finish, I just put in the data and sleep it. On top of all this I synced the contact data to my phone and after verifying it’s accuracy deleted the old information, expecting to have to reconfigure favorites. I didn’t. The transition is seamless. I can’t guarantee that for everyone, so make your backups first!