Skip to content

MemoryLookupKey

Defines an in-memory lookup key for fast data access.

This object can be configured from the WebUI under Settings › Lookups › In-Memory Keys Settings › Spam Filter › Lists › Blocked Domains Settings › Spam Filter › Lists › Spam Traps Settings › Spam Filter › Lists › Trusted Domains Settings › Spam Filter › Lists › URL Redirectors

Type: String · required

The namespace of the key

Type: String · required · max length: 255

The key name

Type: Boolean · default: false

Whether the key is a glob pattern

The MemoryLookupKey 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 sysMemoryLookupKeyGet permission.

Terminal window
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:MemoryLookupKey/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 create, update, and destroy operations in a single call.

This operation requires the sysMemoryLookupKeyCreate permission.

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

This operation requires the sysMemoryLookupKeyUpdate permission.

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

This operation requires the sysMemoryLookupKeyDestroy permission.

Terminal window
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:MemoryLookupKey/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 sysMemoryLookupKeyQuery permission.

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

The x:MemoryLookupKey/query filter argument accepts the following conditions (combinable with AnyOf / AllOf / Not per RFC 8620):

ConditionKind
namespacetext

stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.

Terminal window
stalwart-cli get MemoryLookupKey id1
Terminal window
stalwart-cli create MemoryLookupKey \
--field namespace=Example \
--field key=Example
Terminal window
stalwart-cli query MemoryLookupKey
stalwart-cli query MemoryLookupKey --where namespace=example
Terminal window
stalwart-cli update MemoryLookupKey id1 --field namespace='updated value'
Terminal window
stalwart-cli delete MemoryLookupKey --ids id1