Skip to content

StoreLookup

Defines an external store used for lookups.

This object can be configured from the WebUI under Settings › Lookups › Store Lookups

Type: String · read-only

Unique identifier for this store when used in lookups

Type: LookupStore · required

Store to use for lookups

The StoreLookup object is available via the urn:stalwart:jmap capability.

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

This method requires the sysStoreLookupGet permission.

Terminal window
curl -X POST https://mail.example.com/jmap/ \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:StoreLookup/get",
{
"ids": [
"id1"
]
},
"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.

Supports the following operations in a single call: create, update, destroy.

This operation requires the sysStoreLookupCreate permission.

Terminal window
curl -X POST https://mail.example.com/jmap/ \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:StoreLookup/set",
{
"create": {
"new1": {
"store": {
"@type": "PostgreSql",
"authSecret": {
"@type": "None"
},
"host": "Example",
"readReplicas": {}
}
}
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

This operation requires the sysStoreLookupUpdate permission.

Terminal window
curl -X POST https://mail.example.com/jmap/ \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:StoreLookup/set",
{
"update": {
"id1": {
"store": {
"@type": "PostgreSql",
"authSecret": {
"@type": "None"
},
"host": "Example",
"readReplicas": {}
}
}
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

This operation requires the sysStoreLookupDestroy permission.

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

This is a standard Foo/query method as defined in RFC 8620, Section 5.5.

This method requires the sysStoreLookupQuery permission.

Terminal window
curl -X POST https://mail.example.com/jmap/ \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:StoreLookup/query",
{
"filter": {}
},
"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 StoreLookup id1
Terminal window
stalwart-cli create StoreLookup \
--field 'store={"@type":"PostgreSql","authSecret":{"@type":"None"},"host":"Example","readReplicas":{}}'
Terminal window
stalwart-cli query StoreLookup
Terminal window
stalwart-cli update StoreLookup id1 --field store='{"@type":"PostgreSql","authSecret":{"@type":"None"},"host":"Example","readReplicas":{}}'
Terminal window
stalwart-cli delete StoreLookup --ids id1

Lookup store backends.

PostgreSQL data store.

Type: Duration? · default: 15000

Maximum time to wait for a connection to the database server to be established

Type: Duration? · default: 120000

Maximum time to wait for the database server to start answering a request before the connection is closed and the request fails. When unset, requests wait indefinitely.

Type: Boolean · default: false

Use TLS to connect to the store

Type: Boolean · default: false

Allow invalid TLS certificates when connecting to the store

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

Maximum number of connections to the store. When unset, 4 per CPU core, between 16 and 32.

Type: PostgreSqlRecyclingMethod · default: "fast"

Method to use when recycling connections in the pool

Type: List<PostgreSqlSettings> · enterprise

List of read replicas for the store

Type: String · required

Hostname of the database server

Type: UnsignedInt · default: 5432 · max: 65535 · min: 1

Port of the database server

Type: String · default: "stalwart"

Name of the database

Type: String? · default: "stalwart"

Username to connect to the store

Type: SecretKeyOptional · default: {"@type":"None"}

Password to connect to the store

Type: String?

Additional connection options

PostgreSQL connection settings.

Type: String · required

Hostname of the database server

Type: UnsignedInt · default: 5432 · max: 65535 · min: 1

Port of the database server

Type: String · default: "stalwart"

Name of the database

Type: String? · default: "stalwart"

Username to connect to the store

Type: SecretKeyOptional · default: {"@type":"None"}

Password to connect to the store

Type: String?

Additional connection options

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

MySQL data store.

Type: Duration? · default: 15000

Time an idle connection may stay open before the server closes it (sets the MySQL wait_timeout session variable)

Type: Boolean · default: false

Use TLS to connect to the store

Type: Boolean · default: false

Allow invalid TLS certificates when connecting to the store

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

Maximum size of a packet in bytes

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

Maximum number of connections to the store. When unset, 4 per CPU core, between 16 and 32.

Type: UnsignedInt? · default: 5 · max: 8192 · min: 1

Minimum number of connections to the store

Type: List<MySqlSettings> · enterprise

List of read replicas for the store

Type: String · required

Hostname of the database server

Type: UnsignedInt · default: 3306 · max: 65535 · min: 1

Port of the database server

Type: String · default: "stalwart"

Name of the database

Type: String? · default: "stalwart"

Username to connect to the store

Type: SecretKeyOptional · default: {"@type":"None"}

Password to connect to the store

MySQL connection settings.

Type: String · required

Hostname of the database server

Type: UnsignedInt · default: 3306 · max: 65535 · min: 1

Port of the database server

Type: String · default: "stalwart"

Name of the database

Type: String? · default: "stalwart"

Username to connect to the store

Type: SecretKeyOptional · default: {"@type":"None"}

Password to connect to the store

SQLite embedded data store.

Type: String · required

Path to the SQLite database file, created if missing. When a directory is given, the database is stored in it as stalwart.db

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

Number of worker threads to use for the store, defaults to the number of cores

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

Maximum number of connections to the store. When unset, the number of worker threads, between 4 and 16.

Sharded in-memory store configuration.

Type: List<InMemoryStoreBase> · min items: 2

Stores to use for sharding

In-memory store backends.

Redis/Valkey store.

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

URL of the Redis server

Type: Duration · default: 10000

Maximum time to wait for a new connection to the Redis server to be established

Type: Boolean · default: false

Allow invalid TLS certificates when connecting to the Redis server

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

Maximum number of connections to the store

Type: Duration? · default: 30000

Timeout for creating a new connection

Type: Duration? · default: 30000

Timeout for waiting for a connection from the pool

Type: Duration? · default: 30000

Timeout for recycling a connection

Redis Cluster store.

Type: Set<Uri> · default: {"redis://127.0.0.1":true}

URL(s) of the Redis server(s)

Type: Duration · default: 10000

Maximum time to wait for a new connection to the Redis server to be established

Type: Boolean · default: false

Allow invalid TLS certificates when connecting to the Redis server

Type: String?

Username to connect to the store

Type: SecretKeyOptional · default: {"@type":"None"}

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: 30000

Timeout for creating a new connection

Type: Duration? · default: 30000

Timeout for waiting for a connection from the pool

Type: Duration? · default: 30000

Timeout for recycling a connection

Redis Sentinel store.

Type: Set<Uri> · default: {"redis://127.0.0.1:26379":true}

Address(es) of the Sentinel node(s)

Type: String · default: "mymaster"

Name of the monitored master (service) to query via the Sentinels

Type: Duration · default: 10000

Maximum time to wait for a new connection to the Redis server to be established

Type: Boolean · default: false

Allow invalid TLS certificates when connecting to the Redis server

Type: String?

Username to connect to the data nodes

Type: SecretKeyOptional · default: {"@type":"None"}

Password to connect to the data nodes

Type: String?

Username to connect to the Sentinel nodes

Type: SecretKeyOptional · default: {"@type":"None"}

Password to connect to the Sentinel nodes

Type: RedisProtocol · default: "resp2"

Protocol Version

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

Maximum number of connections to the store

Type: Duration? · default: 30000

Timeout for creating a new connection

Type: Duration? · default: 30000

Timeout for waiting for a connection from the pool

Type: Duration? · default: 30000

Timeout for recycling a connection

Stalwart Keep store.

Type: Set<String> · default: {"127.0.0.1:7000":true} · min items: 1

Stalwart Keep servers to connect to, as host:port pairs. With cluster discovery these are the seeds from which the members are learned; without it only the first one is used

Type: Boolean · default: false

Learn the members of a Stalwart Keep cluster from the servers listed and place each key on the member that owns it. Requires the cluster secret

Type: SecretKeyOptional · default: {"@type":"None"}

Cluster secret, as 32 hexadecimal digits. Required for cluster discovery and for connections without TLS. When set, each request is sent directly to the shard that owns its key

Type: KeepTls · default: {"@type":"Disabled"}

How connections to Stalwart Keep are protected and authenticated

Type: UnsignedInt · default: 16 · min: 1 · max: 1024

Number of connections per server when no cluster secret is set

Type: UnsignedInt · default: 2 · min: 1 · max: 8

Number of connections per server shard when the cluster secret is set

Type: KeepStreamMode · default: "everywhere"

Which servers carry cluster events when this store is the cluster coordinator

Type: Duration · default: 5000

Maximum time to wait for the servers when the store is opened, and for a connection to be established

Type: Duration · default: 1000

Maximum time to wait for the reply to one attempt of a request

Type: Duration · default: 5000

Maximum time a request may take over all its attempts. Must not be shorter than the attempt timeout

How connections to Stalwart Keep are protected and authenticated.

  • Disabled: Plaintext, authenticated with the cluster secret. No additional fields.
  • RawPublicKeys: Mutual TLS with raw public keys. Carries the fields of KeepTlsRawPublicKeys.
  • Authority: Mutual TLS with certificates from a cluster CA. Carries the fields of KeepTlsAuthority.

Mutual TLS 1.3 with raw public keys. Files are read from each node’s filesystem when the store is opened, so every node can have its own key at the same path.

Type: String · required

Path of this node’s private key file, in PEM or DER format

Type: String · required

Path of the PEM file listing the public keys of the Stalwart Keep servers to accept

Mutual TLS 1.3 with certificates from a cluster CA. Files are read from each node’s filesystem when the store is opened, so every node can have its own certificate at the same path.

Type: String · required

Path of the cluster CA certificate file

Type: String · required

Path of this node’s certificate chain file

Type: String · required

Path of this node’s private key file

Type: String?

Name the server certificates must carry. Leave empty to use the host of each server

ValueLabel
fastFast recycling method
verifiedVerified recycling method
cleanClean recycling method
ValueLabel
resp2RESP2
resp3RESP3
ValueLabel
everywhereSubscribe on every server and publish on one
ownerSubscribe and publish on one server chosen per cluster