Skip to content

Overview

Calendar and contact applications on desktop and mobile platforms synchronise with a server through CalDAV and CardDAV, and file managers can mount remote storage through WebDAV. All three rest on WebDAV (RFC 4918), which extends HTTP with methods to manage collections of resources on a server, such as PROPFIND, MKCOL and LOCK.

Stalwart uses WebDAV for three services: file storage with WebDAV itself, calendars with CalDAV (RFC 4791) and contacts with CardDAV (RFC 6352). This page covers the protocol side, and Settings the settings that apply to all three services. The rest of the collaboration section describes calendars, contacts and file storage from the user’s side.

The DAV services are served on every HTTP listener, under these paths:

PathContents
/dav/cal/<account>/The account’s calendars (CalDAV)
/dav/card/<account>/The account’s address books (CardDAV)
/dav/file/<account>/The account’s files (WebDAV)
/dav/pal/<account>/The account’s principal, which clients read to find its collections and access rights
/dav/itip/Calendar scheduling messages

In these paths, <account> identifies the account in one of two forms. The first is any of the account’s email addresses, aliases included, with @ encoded as %40 in the links that the server generates (/dav/cal/jane%40example.com/). The second is _ followed by the numeric account id. Other forms are not accepted: a bare user name such as jane, a sub-address and a catch-all address return 404. Access to another account’s collections requires that the account shared them.

Clients do not need to know these paths, because they find the collections from the server name. /.well-known/caldav and /.well-known/carddav redirect (HTTP 307) to /dav/cal and /dav/card. From there, the client reads the user’s principal and its home collections. Setting up clients lists the settings that clients need.

Besides WebDAV, CalDAV and CardDAV, the server implements a number of related specifications:

Clients learn which of these the server supports from the DAV header returned to OPTIONS requests, which lists the compliance classes: 1, 2, 3, access-control, extended-mkcol, calendar-access, calendar-auto-schedule, calendar-no-timezone, addressbook.

Properties that a client sets with PROPPATCH and that the server does not interpret are called dead properties. They are stored as object metadata, whose limits apply to them.

The WebDav singleton (found in the WebUI under Settings › Network › WebDAV) holds the protocol settings: the sizes of properties, the limits on locks and requests, and the assisted discovery that lets clients find calendars and address books shared with the user. Settings describes each of them.

WebDAV can be restricted for some users or turned off for everyone. A user can use each service only with the corresponding permissions, so removing the CalDAV, CardDAV or WebDAV permissions from a role restricts the users that have it. To turn off the DAV services for all clients, add an access control rule that refuses paths under /dav.