I understand a Thunderbird iCloud calendar sync may be a niche use case. However, if you’re stuck with it you don’t care how much of a niche it is. You’ll want clear instructions how to fix you problem, that is how to add an iCloud calendar to Thunderbird – and you’ll get just that here.
Thunderbird iCloud calendar sync
There are two general approaches how to add an iCloud calendar to Thunderbird
- The lame one: a read-only view of any iCloud calendar. I’ll mention it at the very end of this article for the sake of completeness. It’s a pity that Apple only documented this one.
- The real one i.e. just what you’d expect: full integration, editable calendar with two-way synchronisation. Unfortunately, this is more complicated than it could and should be but I guess Apple really wants you to use their apps exclusively.
Connect an iCloud calendar to Thunderbird
Adding any remote calendar to Thunderbird is trivial. However, with an iCloud calendar it’s more complicated than usual for two reasons:
- You need to deal with two-factor authentication (2FA).
If you log into iCloud Apple requires username/password plus a verification code they send to your mobile. Of course, this is not feasible if Thunderbird authenticates itself against iCloud on your behalf. Therefore you need to create an app-specific password for Thunderbird.
- Apple is not willing to reveal the URL to your remote calendar.
If you don’t know the specific URL to your iCloud calendar you can’t add it to Thunderbird. Some digging is necessary to get a hold of this gold nugget.
Thus, we need to complete the above two steps before we can actually add the iCloud calendar to Thunderbird.
A) Create an app-specific password for Thunderbird
In May 2017 Apple announced:
Beginning on 15 June, app-specific passwords will be required to access your iCloud data using third-party apps such as Microsoft Outlook, Mozilla Thunderbird, or other mail, contacts and calendar services not provided by Apple.
Fortunately this is less complicated than it may sound:
- Sign in to your Apple ID account page.
- In the ‘Security’ section, click ‘Generate Password’ below ‘App-Specific Passwords’.
- Follow the steps on your screen.
Gotcha! Take note of the password Apple generated for you as it’s not stored anywhere. Thus, Apple won’t be able to recover it for you!
B) Discover the URL to your iCloud calendar
iCloud calendar URLs for Thunderbird (and other iCal clients) contain three pieces of information that are unique for each calendar:
There are several ways to find the effective values for your specific calendar but none are “consumer-ready”. What I present below is the easiest I could fine. Let me know if you found something more comfortable.
- Open the iCloud calendar app in the browser of your choice.
- Open the browser’s developer tools aka inspector. Often hitting F12 gets you there but the below table has all the details:
Google Chrome Firefox Internet Explorer/Edge Safari MacOS cmd+opt+i cmd+opt+i n/a cmd+opt+i Windows ctrl+shift+i ctrl+shift+i F12 n/a
- Open the ‘Network’ tab in the devtools
- clear any entries that may already be there
- filter for ‘collections’ (enter that into the text field)
- activate only the ‘XHR’ requests
- Now, on the iCloud page, click the checkmark on the left side of the calendar you want to integrate into Thunderbird.
- The inspector will record a HTTP request against URL that looks something like this
https://<server-number>-calendarws.icloud.com/ca/collections/<calendar-id>?<lots-of-keys-and-values>&dsid=<user-id>&yadayada-etc. Extract server number, calendar ID and user ID and keep them somewhere handy.In my case the user ID is a 9-digit number and the server number consists of 40+ alphanumeric characters and dashes.
- Extract the three highlighted pieces of information.
Alternatives for tech-savvy folks:
- open-source iCloud discovery client (Docker or PHP or Groovy/Java) by Daniel Mühlbachler
- poking through
/Users/<your-username>/Library/Calendarson the Mac
C) Create calendar to Thunderbird
You’re home free! The last step is a trivial one.
In Thunderbird open the ‘Calendar’ tab, then right-click on the left side in the calendar list and select ‘New Calendar’.
In the next dialog select ‘On the Network’ and hit ‘Continue’. The calendar URL you extracted in the previous step needs to be entered in the following dialog after you select ‘CalDAV’ as your calendar format.
Again, the URL is https://<server-number>-caldav.icloud.com/<user-id>/calendars/<calendar-id>/. The actual values for the <xxx> tokens is what you collected in step B.
Thunderbird will then ask you for a password at which point you enter the app-specific iCloud password generated in step A).
Congratulations, well done!
The lame approach, adding a read-only calendar
As I said earlier it’s fairly straight-forward to add an iCloud calendar to Thunderbird in read-only mode but who would want that? FWIW here’s how:
- Open the calendar app on the Mac.
- Right-click a specific calendar.
- Select ‘Share Calendar’.
- Click the ‘Public Calendar’ checkbox in the dialog.
The URL displayed after the last step can then be used to create an iCalendar (ICS), not CalDAV, in Thunderbird that is read-only.