Resources
Meetings need more than people. A meeting room can hold only one meeting at a time, and a projector or a pool car can be in only one place. Organisations therefore treat rooms and equipment as attendees of their own: the organiser invites the room together with the people, and the room accepts the meeting when it is free and declines it when it is already taken. Every attendee then sees from the room’s answer whether the meeting has a place.
Stalwart represents each room or piece of equipment as a resource account. A resource has an email address and a calendar, like a user, but nobody signs in to it. It is booked by inviting its address to an event, and it answers the invitation itself or through the people who manage it.
Resource accounts
Section titled “Resource accounts”A resource is an Account with @type set to Resource (found in the WebUI under Management › Directory › Resources). As with other accounts, name and domainId form its address, and aliases adds further addresses. The other fields describe the resource and how it is booked:
| Field | Meaning |
|---|---|
description | The display name, such as Meeting room 4.12. |
kind | room or equipment, room by default. |
capacity | The number of people a room holds. |
location | Where the resource is, such as the building and floor. |
booking | How invitations are answered: Automatic or Manual, described below. |
delegateIds | The user accounts that manage the resource’s calendar. |
timeZone | The resource’s time zone, used for its working hours. |
capacity and location describe the resource for the people who book it and play no part in booking. Administrators see them in the WebUI’s resource list. With Exchange support enabled, Outlook and the other Exchange clients also see them in the global address list, as described in Resources in clients. JMAP and CalDAV clients do not receive them.
A resource has no credentials, so it cannot sign in with any protocol. It exists only on the server: LDAP, SQL and OpenID Connect directories cannot provide resources, and SCIM does not see them. Its roles default to the default group roles, which give it the permissions it needs to receive and answer invitations. A resource counts as an account towards the tenant account limit, and towards the number of accounts an Enterprise licence covers.
The following object creates a room that books itself, accepts requests from local organisers only, and can be booked up to 90 days ahead for at most four hours:
{ "@type": "Resource", "name": "room-4.12", "domainId": "<domain id>", "description": "Meeting room 4.12", "kind": "room", "capacity": 8, "location": "Building A, 4th floor", "booking": { "@type": "Automatic", "bookingWindow": 7776000000, "maxDuration": 14400000 }, "timeZone": "Europe/Berlin"}Booking requests
Section titled “Booking requests”An organiser books a resource by adding its address to an event as an attendee. The invitation reaches the resource as an iMIP message, an email carrying the event, whether the organiser uses a CalDAV or JMAP client on this server or a mail server elsewhere. The resource processes it like any invitation, so the rules of automatic event addition apply: the sender must be authenticated, by DMARC or by authenticated submission, the message must not be classified as spam, and the resource needs the calendarSchedulingReceive permission. The message itself is also delivered to the resource’s Inbox, like any mail, and counts towards its quota.
What follows depends on booking. With Automatic, the server decides at once and answers for the resource. With Manual, the invitation waits for a delegate.
Automatic booking
Section titled “Automatic booking”An automatically booked resource evaluates each new invitation, and each update the organiser sends, against its booking rules. It then stores the event in its default calendar and sends the organiser an iTIP reply. A resource that accepts sets its participation status to ACCEPTED. A resource that declines sets it to DECLINED and keeps the event in its calendar as free time, so a declined booking never blocks another one. Cancellations and the other iTIP methods are processed as for any attendee; a cancelled event no longer blocks the resource.
The Automatic variant has five settings, checked in this order:
| Setting | Rule | Status of the decline |
|---|---|---|
allowExternal | While disabled, only organisers with an account on this server may book the resource. | 3.8;No authority |
allowRecurring | While disabled, recurring events are declined. It is enabled by default. | 5.0;Request not supported |
bookingWindow | How far ahead the resource can be booked. When it is set, an event that ends later, or a series without an end, is declined. | 5.0;Request not supported |
maxDuration | The longest booking accepted. An event with any occurrence longer than this is declined. | 5.0;Request not supported |
allowConflicts | While disabled, an event that overlaps an existing booking is declined. | 4.0;Event conflict. Date/time is busy. |
The status is written to the reply’s REQUEST-STATUS, so the organiser’s client can show why the resource declined. When bookingWindow and maxDuration are not set, they impose no limit. While bookingWindow is set, a series is also declined when it expands to more occurrences than the maxRecurrenceExpansions limit allows to be checked.
An organiser counts as local when the invitation comes from an address of an account on this server, aliases and sub-addresses included. An invitation from an external organiser that the resource may not accept is answered, but the event is not stored.
A booking conflicts with every event in any of the resource’s calendars that overlaps it in time, unless that event is cancelled, transparent or declined. Events the resource has not yet answered do not block it either. Occurrences that have already ended are ignored, so a series that started in the past can still be booked from now on.
The rules apply again to every update. An organiser who moves a meeting to a time when the room is taken receives a decline for the new time, even though the room had accepted the original one. The event being updated never conflicts with itself.
Requests for the same resource are processed one at a time, so two organisers asking for the same slot at the same moment cannot both be accepted. A request that cannot be processed in turn within a few seconds is left for manual handling instead, and the server logs Resource booking lock is held, request left for manual handling.
Manual booking
Section titled “Manual booking”With Manual, the server applies no rules. The invitation is stored in the resource’s default calendar as received, without an answer, and the resource’s delegates decide. An invitation from an external organiser is stored only under the conditions of automatic event addition: when autoAddInvitations is enabled, or the organiser is in one of the resource’s address books. Otherwise it is not added.
A delegate answers by accepting or declining the event in the resource’s calendar from their own client, and the reply is sent to the organiser in the resource’s name. New requests appear in the resource’s calendar, so delegates need a client that shows that calendar.
Delegates
Section titled “Delegates”The users listed in delegateIds manage the resource’s calendar. Delegates are useful with either booking mode: with Manual they answer the requests, and with Automatic they see the bookings and can correct them, for example to free a room for a meeting that takes priority.
Each delegate receives these rights on the resource’s default calendar: read the calendar and its events, add, change and remove events, change the participation status, read free/busy, and send scheduling replies. Delegates cannot rename or delete the calendar, share it, or send invitations in the resource’s name. The rights are granted as an ordinary share, so the calendar appears in each delegate’s clients like any calendar shared with them. Delegates do not gain access to the resource’s mail.
A delegate must be a user account, in the same tenant as the resource. The number of delegates is limited by maxShares on the Sharing object, and a longer list is refused with A resource can have at most <n> delegates. When a delegate is removed from the list, the share created for the delegation is removed. A share that also carries rights granted separately is kept as it is.
Resources in clients
Section titled “Resources in clients”Clients find resources in the directory, separately from people. JMAP clients see a resource as a principal of type location for a room and resource for equipment, and can filter Principal/query by that type. CalDAV clients see the calendar user type ROOM or RESOURCE on the resource’s principal, and can search for it with a principal-property-search on calendar-user-type.
With Exchange support enabled, resources also appear in the global address list, so they are subject to the same directory query rules as accounts. Outlook reads them through NSPI, the MAPI address book service, which marks each entry as a room or as equipment and carries its capacity and its location, the latter as the office location. The offline address book and ActiveSync name lookups carry the location in the office field but not the capacity. Outlook’s room finder and other EWS clients ask the server for room lists, which group rooms by building or floor. Stalwart has no separate room list object: every mailing list that has at least one room among its recipients is offered as a room list, and the rooms it contains are its entries. A mailing list such as [email protected] whose recipients are the rooms of one building therefore appears as that building’s room list.
Before inviting a resource, the organiser’s client usually checks when it is free. The free/busy time of a resource includes all of its calendars, whatever their sharing or subscriptions, so no share is needed to see when a room is taken. Every user of the server, or of the same tenant when tenants are used, may query it. When the resource has working hours, the time outside them is reported as unavailable, which keeps organisers from booking a room when the building is closed. Working hours inform the organiser but do not decline requests; automatic booking checks only the rules above.