Skip to content

DataRetention

Configures data retention policies, expunge schedules, and archival settings.

This object can be configured from the WebUI under Settings › Storage › Data Retention › Archiving Settings › Storage › Data Retention › Data Cleanup Settings › Storage › Data Retention › Auto-Expunge Settings › Storage › Data Retention › Telemetry

Type: Duration? · default: "30d"

How long to keep messages in the Trash and Junk Mail folders before auto-expunging

Type: Duration? · default: "3d"

How long to keep sent e-mail submissions before auto-expunging

Type: Duration? · default: "30d"

Specifies the duration for which the JMAP share notification history is retained before it is automatically purged.

Type: Duration? · default: "30d"

Sets the duration after which the iTIP inbox will automatically expunge old messages.

Type: Cron · default: {"@type":"Daily","hour":0,"minute":0}

Specifies when to run the auto-expunge process

Type: Cron · default: {"@type":"Daily","hour":2,"minute":0}

How often to purge the data store. Expects a cron expression.

Type: Cron · default: {"@type":"Daily","hour":4,"minute":0}

How often to purge the data store. Expects a cron expression.

Type: UnsignedInt? · default: 10000

How many changes to keep in the history for each account. This is used to determine the changes that have occurred since the last time the client requested changes.

Type: Duration? · enterprise

How long to keep deleted items in the archive before they are permanently deleted. If null, deleted items will not be archived and will be permanently deleted immediately.

Type: Duration? · enterprise

How long to keep deleted accounts in the archive before they are permanently deleted. If null, deleted accounts will be permanently deleted immediately.

Type: Duration? · default: "30d"

The duration for which MTA reports should be stored before being deleted, or None to disable storage

Type: Duration? · enterprise · default: "30d"

How long to keep message delivery history before it is permanently deleted.

Type: Duration? · enterprise · default: "90d"

How long to keep metrics history before it is permanently deleted.

Type: Cron · enterprise · default: {"@type":"Hourly","minute":0}

Specifies how often to collect metrics history.

The DataRetention singleton is available via the urn:stalwart:jmap capability.

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

For singletons, the ids argument should be the literal singleton (or null to return the single instance).

This method requires the sysDataRetentionGet permission.

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

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

For singletons, only the update argument with id singleton is accepted; create and destroy arguments are rejected.

This method requires the sysDataRetentionUpdate permission.

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

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

Terminal window
stalwart-cli get DataRetention
Terminal window
stalwart-cli update DataRetention --field expungeTrashAfter=30d

Defines a recurring schedule.

  • Daily: Every day. Carries the fields of CronDaily.
  • Weekly: Every week. Carries the fields of CronWeekly.
  • Hourly: Every hour. Carries the fields of CronHourly.

A daily recurring schedule at a specific time.

Type: UnsignedInt · default: 0 · max: 23

Hour

Type: UnsignedInt · default: 0 · max: 59

Minute

A weekly recurring schedule on a specific day and time.

Type: UnsignedInt · default: 0 · max: 6

Day

Type: UnsignedInt · default: 0 · max: 23

Hour

Type: UnsignedInt · default: 0 · max: 59

Minute

An hourly recurring schedule at a specific minute.

Type: UnsignedInt · default: 0 · max: 59

Minute