StoreLookup
Defines an external store used for lookups.
This object can be configured from the WebUI under Settings › Lookups › Store Lookups
Fields
namespace
Type:
String· read-onlyUnique identifier for this store when used in lookups
store
Type:
LookupStore· requiredStore to use for lookups
JMAP API
The StoreLookup object is available via the urn:stalwart:jmap capability.
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
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
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",
"allowInvalidCerts": false,
"authSecret": {
"@type": "None"
},
"authUsername": "stalwart",
"database": "stalwart",
"host": "mail.example.com",
"options": "Example",
"poolMaxConnections": 10,
"poolRecyclingMethod": "fast",
"port": 5432,
"readReplicas": [],
"timeout": "15s",
"useTls": false
}
}
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'
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",
"allowInvalidCerts": false,
"authSecret": {
"@type": "None"
},
"authUsername": "stalwart",
"database": "stalwart",
"host": "mail.example.com",
"options": "Example",
"poolMaxConnections": 10,
"poolRecyclingMethod": "fast",
"port": 5432,
"readReplicas": [],
"timeout": "15s",
"useTls": false
}
}
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'
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
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"
]
}'
CLI
stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.
Fetch
stalwart-cli get store-lookup id1
Create
stalwart-cli create store-lookup \
--field 'store={"@type":"PostgreSql","allowInvalidCerts":false,"authSecret":{"@type":"None"},"authUsername":"stalwart","database":"stalwart","host":"mail.example.com","options":"Example","poolMaxConnections":10,"poolRecyclingMethod":"fast","port":5432,"readReplicas":[],"timeout":"15s","useTls":false}'
Query
stalwart-cli query store-lookup
Update
stalwart-cli update store-lookup id1 --field description='Updated'
Delete
stalwart-cli delete store-lookup --ids id1
Nested types
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
PostgreSQL data store.
timeout
Type:
Duration?· default:"15s"Connection timeout to the database
useTls
Type:
Boolean· default:falseUse TLS to connect to the store
allowInvalidCerts
Type:
Boolean· default:falseAllow invalid TLS certificates when connecting to the store
poolMaxConnections
Type:
UnsignedInt?· default:10· max: 8192 · min: 1Maximum number of connections to the store
poolRecyclingMethod
Type:
PostgreSqlRecyclingMethod· default:"fast"Method to use when recycling connections in the pool
readReplicas
Type:
PostgreSqlSettings[]· enterpriseList of read replicas for the store
host
Type:
HostName· requiredHostname of the database server
port
Type:
UnsignedInt· default:5432· max: 65535 · min: 1Port of the database server
database
Type:
String· default:"stalwart"Name of the database
authUsername
Type:
String?· default:"stalwart"Username to connect to the store
authSecret
Type:
SecretKeyOptional· requiredPassword to connect to the store
options
Type:
String?Additional connection options
PostgreSqlSettings
PostgreSQL connection settings.
host
Type:
HostName· requiredHostname of the database server
port
Type:
UnsignedInt· default:5432· max: 65535 · min: 1Port of the database server
database
Type:
String· default:"stalwart"Name of the database
authUsername
Type:
String?· default:"stalwart"Username to connect to the store
authSecret
Type:
SecretKeyOptional· requiredPassword to connect to the store
options
Type:
String?Additional connection options
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
A secret value provided directly.
secret
Type:
String· required · secretPassword or secret value
SecretKeyEnvironmentVariable
A secret value read from an environment variable.
variableName
Type:
String· requiredEnvironment variable name to read the secret from
SecretKeyFile
A secret value read from a file.
filePath
Type:
String· requiredFile path to read the secret from
MySqlStore
MySQL data store.
timeout
Type:
Duration?· default:"15s"Connection timeout to the database
useTls
Type:
Boolean· default:falseUse TLS to connect to the store
allowInvalidCerts
Type:
Boolean· default:falseAllow invalid TLS certificates when connecting to the store
maxAllowedPacket
Type:
UnsignedInt?· max: 1073741824 · min: 1024Maximum size of a packet in bytes
poolMaxConnections
Type:
UnsignedInt?· default:10· max: 8192 · min: 1Maximum number of connections to the store
poolMinConnections
Type:
UnsignedInt?· default:5· max: 8192 · min: 1Minimum number of connections to the store
readReplicas
Type:
MySqlSettings[]· enterpriseList of read replicas for the store
host
Type:
HostName· requiredHostname of the database server
port
Type:
UnsignedInt· default:3306· max: 65535 · min: 1Port of the database server
database
Type:
String· default:"stalwart"Name of the database
authUsername
Type:
String?· default:"stalwart"Username to connect to the store
authSecret
Type:
SecretKeyOptional· requiredPassword to connect to the store
MySqlSettings
MySQL connection settings.
host
Type:
HostName· requiredHostname of the database server
port
Type:
UnsignedInt· default:3306· max: 65535 · min: 1Port of the database server
database
Type:
String· default:"stalwart"Name of the database
authUsername
Type:
String?· default:"stalwart"Username to connect to the store
authSecret
Type:
SecretKeyOptional· requiredPassword to connect to the store
SqliteStore
SQLite embedded data store.
path
Type:
String· requiredPath to the SQLite data directory
poolWorkers
Type:
UnsignedInt?· max: 64 · min: 1Number of worker threads to use for the store, defaults to the number of cores
poolMaxConnections
Type:
UnsignedInt· default:10· max: 8192 · min: 1Maximum number of connections to the store
ShardedInMemoryStore
Sharded in-memory store configuration.
stores
Type:
InMemoryStoreBase[]· min items: 2Stores to use for sharding
InMemoryStoreBase
In-memory store backends.
Redis: Redis/Valkey. Carries the fields ofRedisStore.RedisCluster: Redis Cluster. Carries the fields ofRedisClusterStore.
RedisStore
Redis/Valkey store.
url
Type:
Uri· default:"redis://127.0.0.1"URL of the Redis server
timeout
Type:
Duration· default:"10s"Connection timeout to the database
poolMaxConnections
Type:
UnsignedInt· default:10· max: 8192 · min: 1Maximum number of connections to the store
poolTimeoutCreate
Type:
Duration?· default:"30s"Timeout for creating a new connection
poolTimeoutWait
Type:
Duration?· default:"30s"Timeout for waiting for a connection from the pool
poolTimeoutRecycle
Type:
Duration?· default:"30s"Timeout for recycling a connection
RedisClusterStore
Redis Cluster store.
urls
Type:
Uri[]· default:["redis://127.0.0.1"]URL(s) of the Redis server(s)
timeout
Type:
Duration· default:"10s"Connection timeout to the database
authUsername
Type:
String?· default:"stalwart"Username to connect to the store
authSecret
Type:
SecretKeyOptional· requiredPassword to connect to the store
maxRetryWait
Type:
Duration?· max: 1024 · min: 1Maximum time to wait between retries
minRetryWait
Type:
Duration?· max: 1024 · min: 1Minimum time to wait between retries
maxRetries
Type:
UnsignedInt?· max: 1024 · min: 1Number of retries to connect to the Redis cluster
readFromReplicas
Type:
Boolean· default:trueWhether to read from replicas
protocolVersion
Type:
RedisProtocol· default:"resp2"Protocol Version
poolMaxConnections
Type:
UnsignedInt· default:10· max: 8192 · min: 1Maximum number of connections to the store
poolTimeoutCreate
Type:
Duration?· default:"30s"Timeout for creating a new connection
poolTimeoutWait
Type:
Duration?· default:"30s"Timeout for waiting for a connection from the pool
poolTimeoutRecycle
Type:
Duration?· default:"30s"Timeout for recycling a connection
Enums
PostgreSqlRecyclingMethod
| Value | Label |
|---|---|
fast | Fast recycling method |
verified | Verified recycling method |
clean | Clean recycling method |
RedisProtocol
| Value | Label |
|---|---|
resp2 | RESP2 |
resp3 | RESP3 |