StoreLookup
Defines an external store used for lookups.
This object can be configured from the WebUI under Settings › Lookups › Store Lookups
Fields
Section titled “Fields”namespace
Section titled “namespace”Type:
String· read-onlyUnique identifier for this store when used in lookups
Type:
LookupStore· requiredStore to use for lookups
JMAP API
Section titled “JMAP API”The StoreLookup object is available via the urn:stalwart:jmap capability.
x:StoreLookup/get
Section titled “x:StoreLookup/get”This is a standard Foo/get method as defined in RFC 8620, Section 5.1.
This method requires the sysStoreLookupGet permission.
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" ] }'x:StoreLookup/set
Section titled “x:StoreLookup/set”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.
Create
Section titled “Create”This operation requires the sysStoreLookupCreate permission.
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" ] }'Update
Section titled “Update”This operation requires the sysStoreLookupUpdate permission.
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" ] }'Destroy
Section titled “Destroy”This operation requires the sysStoreLookupDestroy permission.
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" ] }'x:StoreLookup/query
Section titled “x:StoreLookup/query”This is a standard Foo/query method as defined in RFC 8620, Section 5.5.
This method requires the sysStoreLookupQuery permission.
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.
stalwart-cli get StoreLookup id1Create
Section titled “Create”stalwart-cli create StoreLookup \ --field 'store={"@type":"PostgreSql","authSecret":{"@type":"None"},"host":"Example","readReplicas":{}}'stalwart-cli query StoreLookupUpdate
Section titled “Update”stalwart-cli update StoreLookup id1 --field store='{"@type":"PostgreSql","authSecret":{"@type":"None"},"host":"Example","readReplicas":{}}'Delete
Section titled “Delete”stalwart-cli delete StoreLookup --ids id1Nested types
Section titled “Nested types”LookupStore
Section titled “LookupStore”Lookup store backends.
PostgreSql: PostgreSQL. Carries the fields ofPostgreSqlStore.MySql: mySQL. Carries the fields ofMySqlStore.Sqlite: SQLite. Carries the fields ofSqliteStore.Sharded: Sharded Lookup Store. Carries the fields ofShardedInMemoryStore.Redis: Redis/Valkey. Carries the fields ofRedisStore.RedisCluster: Redis Cluster. Carries the fields ofRedisClusterStore.RedisSentinel: Redis Sentinel. Carries the fields ofRedisSentinelStore.Keep: Stalwart Keep. Carries the fields ofKeepStore.
PostgreSqlStore
Section titled “PostgreSqlStore”PostgreSQL data store.
connectTimeout
Section titled “connectTimeout”Type:
Duration?· default:15000Maximum time to wait for a connection to the database server to be established
responseTimeout
Section titled “responseTimeout”Type:
Duration?· default:120000Maximum 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.
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?· max: 8192 · min: 1Maximum number of connections to the store. When unset, 4 per CPU core, between 16 and 32.
poolRecyclingMethod
Section titled “poolRecyclingMethod”Type:
PostgreSqlRecyclingMethod· default:"fast"Method to use when recycling connections in the pool
readReplicas
Section titled “readReplicas”Type:
List<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· default:{"@type":"None"}Password to connect to the store
options
Section titled “options”Type:
String?Additional connection options
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· default:{"@type":"None"}Password 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
MySqlStore
Section titled “MySqlStore”MySQL data store.
idleTimeout
Section titled “idleTimeout”Type:
Duration?· default:15000Time an idle connection may stay open before the server closes it (sets the MySQL wait_timeout session variable)
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?· max: 8192 · min: 1Maximum number of connections to the store. When unset, 4 per CPU core, between 16 and 32.
poolMinConnections
Section titled “poolMinConnections”Type:
UnsignedInt?· default:5· max: 8192 · min: 1Minimum number of connections to the store
readReplicas
Section titled “readReplicas”Type:
List<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· default:{"@type":"None"}Password to connect to the store
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· default:{"@type":"None"}Password to connect to the store
SqliteStore
Section titled “SqliteStore”SQLite embedded data store.
Type:
String· requiredPath to the SQLite database file, created if missing. When a directory is given, the database is stored in it as stalwart.db
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?· max: 8192 · min: 1Maximum number of connections to the store. When unset, the number of worker threads, between 4 and 16.
ShardedInMemoryStore
Section titled “ShardedInMemoryStore”Sharded in-memory store configuration.
stores
Section titled “stores”Type:
List<InMemoryStoreBase>· min items: 2Stores to use for sharding
InMemoryStoreBase
Section titled “InMemoryStoreBase”In-memory store backends.
Redis: Redis/Valkey. Carries the fields ofRedisStore.RedisCluster: Redis Cluster. Carries the fields ofRedisClusterStore.RedisSentinel: Redis Sentinel. Carries the fields ofRedisSentinelStore.
RedisStore
Section titled “RedisStore”Redis/Valkey store.
Type:
Uri· default:"redis://127.0.0.1"URL of the Redis server
connectTimeout
Section titled “connectTimeout”Type:
Duration· default:10000Maximum time to wait for a new connection to the Redis server to be established
allowInvalidCerts
Section titled “allowInvalidCerts”Type:
Boolean· default:falseAllow invalid TLS certificates when connecting to the Redis server
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:30000Timeout for creating a new connection
poolTimeoutWait
Section titled “poolTimeoutWait”Type:
Duration?· default:30000Timeout for waiting for a connection from the pool
poolTimeoutRecycle
Section titled “poolTimeoutRecycle”Type:
Duration?· default:30000Timeout for recycling a connection
RedisClusterStore
Section titled “RedisClusterStore”Redis Cluster store.
Type:
Set<Uri>· default:{"redis://127.0.0.1":true}URL(s) of the Redis server(s)
connectTimeout
Section titled “connectTimeout”Type:
Duration· default:10000Maximum time to wait for a new connection to the Redis server to be established
allowInvalidCerts
Section titled “allowInvalidCerts”Type:
Boolean· default:falseAllow invalid TLS certificates when connecting to the Redis server
authUsername
Section titled “authUsername”Type:
String?Username to connect to the store
authSecret
Section titled “authSecret”Type:
SecretKeyOptional· default:{"@type":"None"}Password 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:30000Timeout for creating a new connection
poolTimeoutWait
Section titled “poolTimeoutWait”Type:
Duration?· default:30000Timeout for waiting for a connection from the pool
poolTimeoutRecycle
Section titled “poolTimeoutRecycle”Type:
Duration?· default:30000Timeout for recycling a connection
RedisSentinelStore
Section titled “RedisSentinelStore”Redis Sentinel store.
Type:
Set<Uri>· default:{"redis://127.0.0.1:26379":true}Address(es) of the Sentinel node(s)
serviceName
Section titled “serviceName”Type:
String· default:"mymaster"Name of the monitored master (service) to query via the Sentinels
connectTimeout
Section titled “connectTimeout”Type:
Duration· default:10000Maximum time to wait for a new connection to the Redis server to be established
allowInvalidCerts
Section titled “allowInvalidCerts”Type:
Boolean· default:falseAllow invalid TLS certificates when connecting to the Redis server
authUsername
Section titled “authUsername”Type:
String?Username to connect to the data nodes
authSecret
Section titled “authSecret”Type:
SecretKeyOptional· default:{"@type":"None"}Password to connect to the data nodes
sentinelUsername
Section titled “sentinelUsername”Type:
String?Username to connect to the Sentinel nodes
sentinelSecret
Section titled “sentinelSecret”Type:
SecretKeyOptional· default:{"@type":"None"}Password to connect to the Sentinel nodes
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:30000Timeout for creating a new connection
poolTimeoutWait
Section titled “poolTimeoutWait”Type:
Duration?· default:30000Timeout for waiting for a connection from the pool
poolTimeoutRecycle
Section titled “poolTimeoutRecycle”Type:
Duration?· default:30000Timeout for recycling a connection
KeepStore
Section titled “KeepStore”Stalwart Keep store.
Type:
Set<String>· default:{"127.0.0.1:7000":true}· min items: 1Stalwart 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
clusterDiscovery
Section titled “clusterDiscovery”Type:
Boolean· default:falseLearn 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
secret
Section titled “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
connections
Section titled “connections”Type:
UnsignedInt· default:16· min: 1 · max: 1024Number of connections per server when no cluster secret is set
shardConnections
Section titled “shardConnections”Type:
UnsignedInt· default:2· min: 1 · max: 8Number of connections per server shard when the cluster secret is set
streamMode
Section titled “streamMode”Type:
KeepStreamMode· default:"everywhere"Which servers carry cluster events when this store is the cluster coordinator
connectTimeout
Section titled “connectTimeout”Type:
Duration· default:5000Maximum time to wait for the servers when the store is opened, and for a connection to be established
attemptTimeout
Section titled “attemptTimeout”Type:
Duration· default:1000Maximum time to wait for the reply to one attempt of a request
deadline
Section titled “deadline”Type:
Duration· default:5000Maximum time a request may take over all its attempts. Must not be shorter than the attempt timeout
KeepTls
Section titled “KeepTls”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 ofKeepTlsRawPublicKeys.Authority: Mutual TLS with certificates from a cluster CA. Carries the fields ofKeepTlsAuthority.
KeepTlsRawPublicKeys
Section titled “KeepTlsRawPublicKeys”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.
keyPath
Section titled “keyPath”Type:
String· requiredPath of this node’s private key file, in PEM or DER format
serverKeysPath
Section titled “serverKeysPath”Type:
String· requiredPath of the PEM file listing the public keys of the Stalwart Keep servers to accept
KeepTlsAuthority
Section titled “KeepTlsAuthority”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.
caPath
Section titled “caPath”Type:
String· requiredPath of the cluster CA certificate file
certPath
Section titled “certPath”Type:
String· requiredPath of this node’s certificate chain file
keyPath
Section titled “keyPath”Type:
String· requiredPath of this node’s private key file
serverName
Section titled “serverName”Type:
String?Name the server certificates must carry. Leave empty to use the host of each server
PostgreSqlRecyclingMethod
Section titled “PostgreSqlRecyclingMethod”| Value | Label |
|---|---|
fast | Fast recycling method |
verified | Verified recycling method |
clean | Clean recycling method |
RedisProtocol
Section titled “RedisProtocol”| Value | Label |
|---|---|
resp2 | RESP2 |
resp3 | RESP3 |
KeepStreamMode
Section titled “KeepStreamMode”| Value | Label |
|---|---|
everywhere | Subscribe on every server and publish on one |
owner | Subscribe and publish on one server chosen per cluster |