DataRetention
DataRetention
Section titled “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
Fields
Section titled “Fields”expungeTrashAfter
Section titled “expungeTrashAfter”Type:
Duration?· default:"30d"How long to keep messages in the Trash and Junk Mail folders before auto-expunging
expungeSubmissionsAfter
Section titled “expungeSubmissionsAfter”Type:
Duration?· default:"3d"How long to keep sent e-mail submissions before auto-expunging
expungeShareNotifyAfter
Section titled “expungeShareNotifyAfter”Type:
Duration?· default:"30d"Specifies the duration for which the JMAP share notification history is retained before it is automatically purged.
expungeSchedulingInboxAfter
Section titled “expungeSchedulingInboxAfter”Type:
Duration?· default:"30d"Sets the duration after which the iTIP inbox will automatically expunge old messages.
expungeSchedule
Section titled “expungeSchedule”Type:
Cron· default:{"@type":"Daily","hour":0,"minute":0}Specifies when to run the auto-expunge process
dataCleanupSchedule
Section titled “dataCleanupSchedule”Type:
Cron· default:{"@type":"Daily","hour":2,"minute":0}How often to purge the data store. Expects a cron expression.
blobCleanupSchedule
Section titled “blobCleanupSchedule”Type:
Cron· default:{"@type":"Daily","hour":4,"minute":0}How often to purge the data store. Expects a cron expression.
maxChangesHistory
Section titled “maxChangesHistory”Type:
UnsignedInt?· default:10000How 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.
archiveDeletedItemsFor
Section titled “archiveDeletedItemsFor”Type:
Duration?· enterpriseHow 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.
archiveDeletedAccountsFor
Section titled “archiveDeletedAccountsFor”Type:
Duration?· enterpriseHow long to keep deleted accounts in the archive before they are permanently deleted. If null, deleted accounts will be permanently deleted immediately.
holdMtaReportsFor
Section titled “holdMtaReportsFor”Type:
Duration?· default:"30d"The duration for which MTA reports should be stored before being deleted, or None to disable storage
holdTracesFor
Section titled “holdTracesFor”Type:
Duration?· enterprise · default:"30d"How long to keep message delivery history before it is permanently deleted.
holdMetricsFor
Section titled “holdMetricsFor”Type:
Duration?· enterprise · default:"90d"How long to keep metrics history before it is permanently deleted.
metricsCollectionInterval
Section titled “metricsCollectionInterval”Type:
Cron· enterprise · default:{"@type":"Hourly","minute":0}Specifies how often to collect metrics history.
JMAP API
Section titled “JMAP API”The DataRetention singleton is available via the urn:stalwart:jmap capability.
x:DataRetention/get
Section titled “x:DataRetention/get”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.
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" ] }'x:DataRetention/set
Section titled “x:DataRetention/set”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.
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.
stalwart-cli get DataRetentionUpdate
Section titled “Update”stalwart-cli update DataRetention --field expungeTrashAfter=30dNested types
Section titled “Nested types”Defines a recurring schedule.
Daily: Every day. Carries the fields ofCronDaily.Weekly: Every week. Carries the fields ofCronWeekly.Hourly: Every hour. Carries the fields ofCronHourly.
CronDaily
Section titled “CronDaily”A daily recurring schedule at a specific time.
Type:
UnsignedInt· default:0· max: 23Hour
minute
Section titled “minute”Type:
UnsignedInt· default:0· max: 59Minute
CronWeekly
Section titled “CronWeekly”A weekly recurring schedule on a specific day and time.
Type:
UnsignedInt· default:0· max: 6Day
Type:
UnsignedInt· default:0· max: 23Hour
minute
Section titled “minute”Type:
UnsignedInt· default:0· max: 59Minute
CronHourly
Section titled “CronHourly”An hourly recurring schedule at a specific minute.
minute
Section titled “minute”Type:
UnsignedInt· default:0· max: 59Minute