Skip to content

InMemoryStore

Configures the in-memory cache and lookup store.

This object can be configured from the WebUI under Settings › Storage › In-Memory Store

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.

Use data store

Sharded Store

Type: InMemoryStoreBase[] · min items: 2

Stores to use for sharding

Redis/Valkey

Type: Uri · default: "redis://127.0.0.1"

URL of the Redis server

Type: Duration · default: "10s"

Connection timeout to the database

Type: UnsignedInt · default: 10 · max: 8192 · min: 1

Maximum number of connections to the store

Type: Duration? · default: "30s"

Timeout for creating a new connection

Type: Duration? · default: "30s"

Timeout for waiting for a connection from the pool

Type: Duration? · default: "30s"

Timeout for recycling a connection

Redis Cluster

Type: Uri[] · default: ["redis://127.0.0.1"]

URL(s) of the Redis server(s)

Type: Duration · default: "10s"

Connection timeout to the database

Type: String? · default: "stalwart"

Username to connect to the store

Type: SecretKeyOptional · required

Password to connect to the store

Type: Duration? · max: 1024 · min: 1

Maximum time to wait between retries

Type: Duration? · max: 1024 · min: 1

Minimum time to wait between retries

Type: UnsignedInt? · max: 1024 · min: 1

Number of retries to connect to the Redis cluster

Type: Boolean · default: true

Whether to read from replicas

Type: RedisProtocol · default: "resp2"

Protocol Version

Type: UnsignedInt · default: 10 · max: 8192 · min: 1

Maximum number of connections to the store

Type: Duration? · default: "30s"

Timeout for creating a new connection

Type: Duration? · default: "30s"

Timeout for waiting for a connection from the pool

Type: Duration? · default: "30s"

Timeout for recycling a connection

The InMemoryStore 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 sysInMemoryStoreGet permission.

Terminal window
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"
]
}'

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.

Terminal window
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.

Terminal window
stalwart-cli get InMemoryStore
Terminal window
stalwart-cli update InMemoryStore --field description='updated value'

In-memory store backends.

Redis/Valkey store.

Type: Uri · default: "redis://127.0.0.1"

URL of the Redis server

Type: Duration · default: "10s"

Connection timeout to the database

Type: UnsignedInt · default: 10 · max: 8192 · min: 1

Maximum number of connections to the store

Type: Duration? · default: "30s"

Timeout for creating a new connection

Type: Duration? · default: "30s"

Timeout for waiting for a connection from the pool

Type: Duration? · default: "30s"

Timeout for recycling a connection

Redis Cluster store.

Type: Uri[] · default: ["redis://127.0.0.1"]

URL(s) of the Redis server(s)

Type: Duration · default: "10s"

Connection timeout to the database

Type: String? · default: "stalwart"

Username to connect to the store

Type: SecretKeyOptional · required

Password to connect to the store

Type: Duration? · max: 1024 · min: 1

Maximum time to wait between retries

Type: Duration? · max: 1024 · min: 1

Minimum time to wait between retries

Type: UnsignedInt? · max: 1024 · min: 1

Number of retries to connect to the Redis cluster

Type: Boolean · default: true

Whether to read from replicas

Type: RedisProtocol · default: "resp2"

Protocol Version

Type: UnsignedInt · default: 10 · max: 8192 · min: 1

Maximum number of connections to the store

Type: Duration? · default: "30s"

Timeout for creating a new connection

Type: Duration? · default: "30s"

Timeout for waiting for a connection from the pool

Type: Duration? · default: "30s"

Timeout for recycling a connection

An optional secret value, or none.

  • None: No secret. No additional fields.
  • Value: Secret value. Carries the fields of SecretKeyValue.
  • EnvironmentVariable: Secret read from environment variable. Carries the fields of SecretKeyEnvironmentVariable.
  • File: Secret read from file. Carries the fields of SecretKeyFile.

A secret value provided directly.

Type: String · required · secret

Password or secret value

A secret value read from an environment variable.

Type: String · required

Environment variable name to read the secret from

A secret value read from a file.

Type: String · required

File path to read the secret from

ValueLabel
resp2RESP2
resp3RESP3