Skip to content

Settings

The WebDav singleton holds the settings that apply to all WebDAV, CalDAV and CardDAV resources: property sizes, locks, request limits and the discovery of shared calendars and address books. It is found in the WebUI under Settings › Network › WebDAV.

Changes take effect after a settings reload. The URLs, the specifications implemented and the ways of turning the DAV services off are described in the WebDAV overview.

Clients read and write metadata about a resource, such as a file, a calendar or an address book, as WebDAV properties, using the PROPFIND and PROPPATCH methods. Properties are of two kinds, and the server treats them differently.

Live properties are maintained by the server, such as getlastmodified, resourcetype and quota-available-bytes, or the properties defined by CalDAV and CardDAV. The server computes them, or restricts how they may be changed. Where a client may set a live property, maxLivePropertySize limits the size of the value.

Dead properties are arbitrary name-value pairs set by a client, such as a display colour. The server stores and returns them without interpreting them. They are stored as object metadata, the same storage that holds JMAP object metadata and IMAP annotations, so a value set through one protocol is visible through the others. For the same reason, their size and number are limited by the Metadata object: per property, per resource, and in the number of entries per resource, as described in Object metadata.

When several clients write the same resource, one client’s changes can overwrite another’s. A WebDAV lock prevents such conflicting changes. A client acquires a lock with the LOCK method and receives a lock token. It includes the token in later requests to prove that it holds the lock, and it releases the lock with UNLOCK. Lock tokens use the format described in URN namespace.

Locks come in two kinds. An exclusive lock prevents every other client from modifying the resource. A shared lock allows several clients, each holding a shared lock, to work on the resource.

Two settings limit locking. The first bounds how long a lock can last. maxLockTimeout is the longest time a lock can be held, 1 hour by default. A client that requests a longer timeout, or no timeout, receives this value. A lock that is not refreshed then expires, so a client that disappears cannot block a resource indefinitely.

The second bounds how many locks a user can hold. maxLocks is the number of locks one user can hold at the same time on the resources of one account, and 0 removes the limit. A LOCK request beyond the limit fails with HTTP status 429.

A single WebDAV request can carry a large file, or ask for thousands of resources in one response. Two limits protect the server from requests that would use excessive memory.

maxRequestSize is the largest request body accepted, 25 MiB unless changed. It applies alike to uploaded files, to imported calendar and address book entries and to XML requests. Accounts with the unlimitedUploads permission are exempt.

maxResults is the largest number of resources returned in one PROPFIND or REPORT response. The limit does not hide anything from clients, which receive the rest in further requests. Connection and request limits describes how these limits relate to the other request limits of the server.

The size of the calendar events and contacts themselves is limited by the calendar and address book settings, described in Calendars and Contacts.

Each account and group has its own calendar and address book home, the collection under which its calendars or address books live. The calendars of the account john live under /dav/cal/john/, and the address books of a group named sales under /dav/card/sales/. A calendar that another account shares with john stays under that other account’s home.

CalDAV and CardDAV clients discover calendars and address books through the calendar-home-set and addressbook-home-set properties of the user’s principal. The standards allow several homes in these properties, so Stalwart can list the user’s own home together with the home of every account that shares something with the user. Many clients, however, read only the first home, and so they never see the shared collections.

Assisted discovery works around these clients. It is controlled by enableAssistedDiscovery, which is enabled by default, and it changes what the home-set properties and the home contain.

With assisted discovery enabled, the home-set properties contain only the user’s own home. A PROPFIND on that home lists the user’s own calendars or address books, followed by every calendar or address book that other accounts share with the user, including groups the user belongs to. Clients that read one home therefore see all the collections. Synchronisation reports on the home are not changed, and file storage is not affected.

With assisted discovery disabled, the home-set properties list the user’s own home and the home of each account that shares calendars or address books with the user. Each home lists only its own collections. This is the behaviour the standards describe.

The choice involves two trade-offs. Assisted discovery lists collections of other accounts under the user’s home, and clients that follow the standards strictly may not expect them there, so disable it when all clients in use support several home sets. It also has a cost: on accounts with access to many shared accounts, a PROPFIND on the home reads the collections of every one of them.

Some clients do not show shared resources with either setting. The remedy then lies in the client, which needs support for WebDAV ACL (RFC 3744) and for several home sets.