Skip to main content
Version: 0.16

MtaDeliverySchedule

Defines retry and notification intervals for message delivery.

This object can be configured from the WebUI under Settings › MTA › Outbound › Delivery Schedules

Fields

name

Type: String · read-only

Short identifier for the schedule

description

Type: String?

A short description of the schedule, which can be used to identify it in the list of schedules

expiry

Type: MtaDeliveryExpiration · required

Whether to expire messages after a number of delivery attempts or after certain time (TTL)

notify

Type: MtaDeliveryScheduleIntervalsOrDefault · required

List of delayed delivery DSN notification intervals

queueId

Type: Id<MtaVirtualQueue> · required

The name of the virtual queue to use for this schedule

retry

Type: MtaDeliveryScheduleIntervalsOrDefault · required

List of retry intervals for message delivery

JMAP API

The MtaDeliverySchedule object is available via the urn:stalwart:jmap capability.

x:MtaDeliverySchedule/get

This is a standard Foo/get method as defined in RFC 8620, Section 5.1.

This method requires the sysMtaDeliveryScheduleGet permission.

curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:MtaDeliverySchedule/get",
{
"ids": [
"id1"
]
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

x:MtaDeliverySchedule/set

This is a standard Foo/set method as defined in RFC 8620, Section 5.3.

Supports create, update, and destroy operations in a single call.

Create

This operation requires the sysMtaDeliveryScheduleCreate permission.

curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:MtaDeliverySchedule/set",
{
"create": {
"new1": {
"description": "Example",
"expiry": {
"@type": "Ttl",
"expire": "3d"
},
"notify": {
"@type": "Default"
},
"queueId": "<MtaVirtualQueue id>",
"retry": {
"@type": "Default"
}
}
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

Update

This operation requires the sysMtaDeliveryScheduleUpdate permission.

curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:MtaDeliverySchedule/set",
{
"update": {
"id1": {
"description": "updated value"
}
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

Destroy

This operation requires the sysMtaDeliveryScheduleDestroy permission.

curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:MtaDeliverySchedule/set",
{
"destroy": [
"id1"
]
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

x:MtaDeliverySchedule/query

This is a standard Foo/query method as defined in RFC 8620, Section 5.5.

This method requires the sysMtaDeliveryScheduleQuery permission.

curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:MtaDeliverySchedule/query",
{
"filter": {
"name": "example"
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

The x:MtaDeliverySchedule/query filter argument accepts the following conditions (combinable with AnyOf / AllOf / Not per RFC 8620):

ConditionKind
nametext

CLI

stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.

Fetch

stalwart-cli get mta-delivery-schedule id1

Create

stalwart-cli create mta-delivery-schedule \
--field description=Example \
--field 'expiry={"@type":"Ttl","expire":"3d"}' \
--field 'notify={"@type":"Default"}' \
--field 'queueId=<MtaVirtualQueue id>' \
--field 'retry={"@type":"Default"}'

Query

stalwart-cli query mta-delivery-schedule
stalwart-cli query mta-delivery-schedule --where name=example

Update

stalwart-cli update mta-delivery-schedule id1 --field description='Updated'

Delete

stalwart-cli delete mta-delivery-schedule --ids id1

Nested types

MtaDeliveryExpiration

Defines the message expiration policy for undelivered messages.

MtaDeliveryExpirationTtl

Defines a time-to-live based message expiration policy.

expire

Type: Duration · default: "3d"

Time after which the message will be expired if it is not delivered

MtaDeliveryExpirationAttempts

Defines a delivery-attempts based message expiration policy.

maxAttempts

Type: UnsignedInt · default: 5 · min: 1

Maximum number of delivery attempts before the message is considered failed

MtaDeliveryScheduleIntervalsOrDefault

Defines whether to use the default delivery schedule intervals or specify custom intervals.

  • Default: Use default intervals. No additional fields.
  • Custom: Specify custom intervals. Carries the fields of MtaDeliveryScheduleIntervals.

MtaDeliveryScheduleIntervals

Defines a custom list of delivery retry or notification intervals.

intervals

Type: MtaDeliveryScheduleInterval[] · min items: 1

List of intervals

MtaDeliveryScheduleInterval

Defines a single time interval entry used in a delivery schedule.

duration

Type: Duration · default: "1h"

Time interval for retries or notifications