DataStore
DataStore
Section titled “DataStore”Configures the primary data store backend.
This object can be configured from the WebUI under Settings › Storage › Data Store
Fields
Section titled “Fields”DataStore is a multi-variant object: each instance has an @type discriminator selecting one of the variants below, and each variant carries its own set of fields.
@type: "RocksDb"
Section titled “@type: "RocksDb"”RocksDB
Type:
String· requiredPath to the RocksDB data directory
blobSize
Section titled “blobSize”Type:
Size· default:16834· max: 1048576 · min: 1024Minimum size of a blob to store in the blob store, smaller blobs are stored in the metadata store
bufferSize
Section titled “bufferSize”Type:
Size· default:134217728· max: 1073741824 · min: 8192Size of the write buffer in bytes, used to batch writes to the store
poolWorkers
Section titled “poolWorkers”Type:
UnsignedInt?· max: 64 · min: 1Number of worker threads to use for the store, defaults to the number of cores
@type: "Sqlite"
Section titled “@type: "Sqlite"”SQLite
Type:
String· requiredPath to the SQLite data directory
poolWorkers
Section titled “poolWorkers”Type:
UnsignedInt?· max: 64 · min: 1Number of worker threads to use for the store, defaults to the number of cores
poolMaxConnections
Section titled “poolMaxConnections”Type:
UnsignedInt· default:10· max: 8192 · min: 1Maximum number of connections to the store
@type: "FoundationDb"
Section titled “@type: "FoundationDb"”FoundationDB
clusterFile
Section titled “clusterFile”Type:
String?Path to the cluster file for the FoundationDB cluster
datacenterId
Section titled “datacenterId”Type:
String?Data center ID (optional)
machineId
Section titled “machineId”Type:
String?Machine ID in the FoundationDB cluster (optional)
transactionRetryDelay
Section titled “transactionRetryDelay”Type:
Duration?Transaction maximum retry delay
transactionRetryLimit
Section titled “transactionRetryLimit”Type:
UnsignedInt?· max: 1000 · min: 1Transaction retry limit
transactionTimeout
Section titled “transactionTimeout”Type:
Duration?Transaction timeout
@type: "PostgreSql"
Section titled “@type: "PostgreSql"”PostgreSQL
timeout
Section titled “timeout”Type:
Duration?· default:"15s"Connection timeout to the database
useTls
Section titled “useTls”Type:
Boolean· default:falseUse TLS to connect to the store
allowInvalidCerts
Section titled “allowInvalidCerts”Type:
Boolean· default:falseAllow invalid TLS certificates when connecting to the store
poolMaxConnections
Section titled “poolMaxConnections”Type:
UnsignedInt?· default:10· max: 8192 · min: 1Maximum number of connections to the store
poolRecyclingMethod
Section titled “poolRecyclingMethod”Type:
PostgreSqlRecyclingMethod· default:"fast"Method to use when recycling connections in the pool
readReplicas
Section titled “readReplicas”Type:
PostgreSqlSettings[]· enterpriseList of read replicas for the store
Type:
String· requiredHostname of the database server
Type:
UnsignedInt· default:5432· max: 65535 · min: 1Port of the database server
database
Section titled “database”Type:
String· default:"stalwart"Name of the database
authUsername
Section titled “authUsername”Type:
String?· default:"stalwart"Username to connect to the store
authSecret
Section titled “authSecret”Type:
SecretKeyOptional· requiredPassword to connect to the store
options
Section titled “options”Type:
String?Additional connection options
@type: "MySql"
Section titled “@type: "MySql"”mySQL
timeout
Section titled “timeout”Type:
Duration?· default:"15s"Connection timeout to the database
useTls
Section titled “useTls”Type:
Boolean· default:falseUse TLS to connect to the store
allowInvalidCerts
Section titled “allowInvalidCerts”Type:
Boolean· default:falseAllow invalid TLS certificates when connecting to the store
maxAllowedPacket
Section titled “maxAllowedPacket”Type:
UnsignedInt?· max: 1073741824 · min: 1024Maximum size of a packet in bytes
poolMaxConnections
Section titled “poolMaxConnections”Type:
UnsignedInt?· default:10· max: 8192 · min: 1Maximum number of connections to the store
poolMinConnections
Section titled “poolMinConnections”Type:
UnsignedInt?· default:5· max: 8192 · min: 1Minimum number of connections to the store
readReplicas
Section titled “readReplicas”Type:
MySqlSettings[]· enterpriseList of read replicas for the store
Type:
String· requiredHostname of the database server
Type:
UnsignedInt· default:3306· max: 65535 · min: 1Port of the database server
database
Section titled “database”Type:
String· default:"stalwart"Name of the database
authUsername
Section titled “authUsername”Type:
String?· default:"stalwart"Username to connect to the store
authSecret
Section titled “authSecret”Type:
SecretKeyOptional· requiredPassword to connect to the store
JMAP API
Section titled “JMAP API”The DataStore singleton is available via the urn:stalwart:jmap capability.
x:DataStore/get
Section titled “x:DataStore/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 sysDataStoreGet permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:DataStore/get", { "ids": [ "singleton" ] }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'x:DataStore/set
Section titled “x:DataStore/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 sysDataStoreUpdate permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:DataStore/set", { "update": { "singleton": { "path": "updated value" } } }, "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 DataStoreUpdate
Section titled “Update”stalwart-cli update DataStore --field path='updated value'Nested types
Section titled “Nested types”PostgreSqlSettings
Section titled “PostgreSqlSettings”PostgreSQL connection settings.
Type:
String· requiredHostname of the database server
Type:
UnsignedInt· default:5432· max: 65535 · min: 1Port of the database server
database
Section titled “database”Type:
String· default:"stalwart"Name of the database
authUsername
Section titled “authUsername”Type:
String?· default:"stalwart"Username to connect to the store
authSecret
Section titled “authSecret”Type:
SecretKeyOptional· requiredPassword to connect to the store
options
Section titled “options”Type:
String?Additional connection options
SecretKeyOptional
Section titled “SecretKeyOptional”An optional secret value, or none.
None: No secret. No additional fields.Value: Secret value. Carries the fields ofSecretKeyValue.EnvironmentVariable: Secret read from environment variable. Carries the fields ofSecretKeyEnvironmentVariable.File: Secret read from file. Carries the fields ofSecretKeyFile.
SecretKeyValue
Section titled “SecretKeyValue”A secret value provided directly.
secret
Section titled “secret”Type:
String· required · secretPassword or secret value
SecretKeyEnvironmentVariable
Section titled “SecretKeyEnvironmentVariable”A secret value read from an environment variable.
variableName
Section titled “variableName”Type:
String· requiredEnvironment variable name to read the secret from
SecretKeyFile
Section titled “SecretKeyFile”A secret value read from a file.
filePath
Section titled “filePath”Type:
String· requiredFile path to read the secret from
MySqlSettings
Section titled “MySqlSettings”MySQL connection settings.
Type:
String· requiredHostname of the database server
Type:
UnsignedInt· default:3306· max: 65535 · min: 1Port of the database server
database
Section titled “database”Type:
String· default:"stalwart"Name of the database
authUsername
Section titled “authUsername”Type:
String?· default:"stalwart"Username to connect to the store
authSecret
Section titled “authSecret”Type:
SecretKeyOptional· requiredPassword to connect to the store
PostgreSqlRecyclingMethod
Section titled “PostgreSqlRecyclingMethod”| Value | Label |
|---|---|
fast | Fast recycling method |
verified | Verified recycling method |
clean | Clean recycling method |