InMemoryStore
InMemoryStore
Section titled “InMemoryStore”Configures the in-memory cache and lookup store.
This object can be configured from the WebUI under Settings › Storage › In-Memory Store
Fields
Section titled “Fields”InMemoryStore 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: "Default"
Section titled “@type: "Default"”Use data store
@type: "Sharded"
Section titled “@type: "Sharded"”Sharded Store
stores
Section titled “stores”Type:
InMemoryStoreBase[]· min items: 2Stores to use for sharding
@type: "Redis"
Section titled “@type: "Redis"”Redis/Valkey
Type:
Uri· default:"redis://127.0.0.1"URL of the Redis server
timeout
Section titled “timeout”Type:
Duration· default:"10s"Connection timeout to the database
poolMaxConnections
Section titled “poolMaxConnections”Type:
UnsignedInt· default:10· max: 8192 · min: 1Maximum number of connections to the store
poolTimeoutCreate
Section titled “poolTimeoutCreate”Type:
Duration?· default:"30s"Timeout for creating a new connection
poolTimeoutWait
Section titled “poolTimeoutWait”Type:
Duration?· default:"30s"Timeout for waiting for a connection from the pool
poolTimeoutRecycle
Section titled “poolTimeoutRecycle”Type:
Duration?· default:"30s"Timeout for recycling a connection
@type: "RedisCluster"
Section titled “@type: "RedisCluster"”Redis Cluster
Type:
Uri[]· default:["redis://127.0.0.1"]URL(s) of the Redis server(s)
timeout
Section titled “timeout”Type:
Duration· default:"10s"Connection timeout to 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
maxRetryWait
Section titled “maxRetryWait”Type:
Duration?· max: 1024 · min: 1Maximum time to wait between retries
minRetryWait
Section titled “minRetryWait”Type:
Duration?· max: 1024 · min: 1Minimum time to wait between retries
maxRetries
Section titled “maxRetries”Type:
UnsignedInt?· max: 1024 · min: 1Number of retries to connect to the Redis cluster
readFromReplicas
Section titled “readFromReplicas”Type:
Boolean· default:trueWhether to read from replicas
protocolVersion
Section titled “protocolVersion”Type:
RedisProtocol· default:"resp2"Protocol Version
poolMaxConnections
Section titled “poolMaxConnections”Type:
UnsignedInt· default:10· max: 8192 · min: 1Maximum number of connections to the store
poolTimeoutCreate
Section titled “poolTimeoutCreate”Type:
Duration?· default:"30s"Timeout for creating a new connection
poolTimeoutWait
Section titled “poolTimeoutWait”Type:
Duration?· default:"30s"Timeout for waiting for a connection from the pool
poolTimeoutRecycle
Section titled “poolTimeoutRecycle”Type:
Duration?· default:"30s"Timeout for recycling a connection
JMAP API
Section titled “JMAP API”The InMemoryStore singleton is available via the urn:stalwart:jmap capability.
x:InMemoryStore/get
Section titled “x:InMemoryStore/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 sysInMemoryStoreGet permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:InMemoryStore/get", { "ids": [ "singleton" ] }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'x:InMemoryStore/set
Section titled “x:InMemoryStore/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 sysInMemoryStoreUpdate permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:InMemoryStore/set", { "update": { "singleton": { "description": "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 InMemoryStoreUpdate
Section titled “Update”stalwart-cli update InMemoryStore --field description='updated value'Nested types
Section titled “Nested types”InMemoryStoreBase
Section titled “InMemoryStoreBase”In-memory store backends.
Redis: Redis/Valkey. Carries the fields ofRedisStore.RedisCluster: Redis Cluster. Carries the fields ofRedisClusterStore.
RedisStore
Section titled “RedisStore”Redis/Valkey store.
Type:
Uri· default:"redis://127.0.0.1"URL of the Redis server
timeout
Section titled “timeout”Type:
Duration· default:"10s"Connection timeout to the database
poolMaxConnections
Section titled “poolMaxConnections”Type:
UnsignedInt· default:10· max: 8192 · min: 1Maximum number of connections to the store
poolTimeoutCreate
Section titled “poolTimeoutCreate”Type:
Duration?· default:"30s"Timeout for creating a new connection
poolTimeoutWait
Section titled “poolTimeoutWait”Type:
Duration?· default:"30s"Timeout for waiting for a connection from the pool
poolTimeoutRecycle
Section titled “poolTimeoutRecycle”Type:
Duration?· default:"30s"Timeout for recycling a connection
RedisClusterStore
Section titled “RedisClusterStore”Redis Cluster store.
Type:
Uri[]· default:["redis://127.0.0.1"]URL(s) of the Redis server(s)
timeout
Section titled “timeout”Type:
Duration· default:"10s"Connection timeout to 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
maxRetryWait
Section titled “maxRetryWait”Type:
Duration?· max: 1024 · min: 1Maximum time to wait between retries
minRetryWait
Section titled “minRetryWait”Type:
Duration?· max: 1024 · min: 1Minimum time to wait between retries
maxRetries
Section titled “maxRetries”Type:
UnsignedInt?· max: 1024 · min: 1Number of retries to connect to the Redis cluster
readFromReplicas
Section titled “readFromReplicas”Type:
Boolean· default:trueWhether to read from replicas
protocolVersion
Section titled “protocolVersion”Type:
RedisProtocol· default:"resp2"Protocol Version
poolMaxConnections
Section titled “poolMaxConnections”Type:
UnsignedInt· default:10· max: 8192 · min: 1Maximum number of connections to the store
poolTimeoutCreate
Section titled “poolTimeoutCreate”Type:
Duration?· default:"30s"Timeout for creating a new connection
poolTimeoutWait
Section titled “poolTimeoutWait”Type:
Duration?· default:"30s"Timeout for waiting for a connection from the pool
poolTimeoutRecycle
Section titled “poolTimeoutRecycle”Type:
Duration?· default:"30s"Timeout for recycling a connection
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
RedisProtocol
Section titled “RedisProtocol”| Value | Label |
|---|---|
resp2 | RESP2 |
resp3 | RESP3 |