StoreLookup
StoreLookup
Section titled “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/api \ -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 create, update, and destroy operations in a single call.
Create
Section titled “Create”This operation requires the sysStoreLookupCreate permission.
curl -X POST https://mail.example.com/api \ -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/api \ -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/api \ -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/api \ -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.
PostgreSqlStore
Section titled “PostgreSqlStore”PostgreSQL data store.
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
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
MySqlStore
Section titled “MySqlStore”MySQL data store.
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
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
SqliteStore
Section titled “SqliteStore”SQLite embedded data store.
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
ShardedInMemoryStore
Section titled “ShardedInMemoryStore”Sharded in-memory store configuration.
stores
Section titled “stores”Type:
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.
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
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 |