Skip to main content
Version: 0.16

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

Fields

namespace

Type: String · required

The namespace of the key

key

Type: String · required · max length: 255

The key name

isGlobPattern

Type: Boolean · default: false

Whether the key is a glob pattern

JMAP API

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

x:MemoryLookupKey/get

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

This method requires the sysMemoryLookupKeyGet permission.

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"
]
}'

x:MemoryLookupKey/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 sysMemoryLookupKeyCreate permission.

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

Update

This operation requires the sysMemoryLookupKeyUpdate permission.

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"
]
}'

Destroy

This operation requires the sysMemoryLookupKeyDestroy permission.

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"
]
}'

x:MemoryLookupKey/query

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

This method requires the sysMemoryLookupKeyQuery permission.

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

CLI

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

Fetch

stalwart-cli get memory-lookup-key id1

Create

stalwart-cli create memory-lookup-key \
--field namespace=Example \
--field key=Example \
--field isGlobPattern=false

Query

stalwart-cli query memory-lookup-key
stalwart-cli query memory-lookup-key --where namespace=example

Update

stalwart-cli update memory-lookup-key id1 --field description='Updated'

Delete

stalwart-cli delete memory-lookup-key --ids id1