Making wpcal.io work with Zimbra calendars

July 1, 2021 

Scheduling meetings with email is annoying. When everyone is on the same timezone that kind of works, but tends to be slow. When you factor in timezone differences the process becomes really error-prone and slows down even more, often to several days. For this reason we wanted to provide people - including our customers - a way to easily schedule meetings with us.

We're special in the sense that we self-host almost everything we use. For email and calendars we use Zimbra and for our website we use WordPress. Most people seem to use Calendly as a meeting scheduler, but we ended up choosing wpcal.io which is a native WordPress plugin and seems to work quite nicely.

One of the main features of meeting schedulers is to be able to check from a remote calendar whether the person(s) the calendar applies to are available and only show the free slots to people booking the meeting. Wpcal.io currently supports Google Calendar only, and we could not (unsurprisingly!) find any other meeting schedulers that would natively support Zimbra.

Going against the grain has a cost ("Why don't you just use Microsoft or Google?"). In this case this meant configuring a two-way synchronization between Zimbra and Google Calendar. Much of the process is outlined in Zimbra wiki, but here's a high-level overview:

  1. Create a new "project" in Google Developer Console. The sole purpose of this step is to create an OAuth2 client and to authorize it to access the Google CalDAV endpoint for your Google calendar. This does not seem be what the "projects" were meant for - they seem to be for "applications" so you'll probably need to leave your "app" in "testing mode". But if it works, who cares?
  2. Ensure that your Google account is on the "test users" list for the "project"
  3. Enable CalDAV API for the "project"
  4. Set some *OAuth* settings on the Zimbra server with zmprov
  5. Login to Zimbra webui and add your Google calendar as a remote CalDAV calendar (URLs and all that here)
  6. Allow Google to modify Zimbra calendars by visiting a special Zimbra URL (e.g. https://mail.example.org/service/extension/oauth2/authorize/google?type=caldav)

Zimbra will start trying to synchronize between Zimbra and Google after step #4, but it will fail until you complete step #5. To debug use mailbox.log file as you don't have much visibility at the Google end.

I also remember setting setting some OAuth2 scope at the Google end to allow CalDAV access. Looking back I could not find where that was done, nor if it was actually required.

Once basic synchronization is working you probably want to create a dedicated "work calendar" in Google. This allows you to keep your private Google calendar (if any) private and share the work calendar with other Zimbra users. You also want (or need) to start using the Zimbra/Google work calendar as your main Zimbra calendar. This may sound strange at first, but the Zimbra <-> Google calendar sync actually does not synchronize between native Zimbra calendars and Google calendar, but between the calendar exposed by Google to Zimbra via CalDAV and the corresponding Google calendar. In other words you have have calendar shared by Zimbra and Google that gets synchronized two ways periodically. So, unless you add your work events to that calendar they won't show up in the meeting scheduler and you could end up with double bookings.

The final (easy) step is to configure wpcal.io to check your presence from all the Google calendars you want, one of which is your new work calendar in Zimbra/Google and the other probably your personal Google calendar. After that your meeting scheduler should work just as it says on the tin.

Samuli Seppänen
Samuli Seppänen
Author archive
menucross-circle