MemoryLookupKey
MemoryLookupKey
Section titled “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
Section titled “Fields”namespace
Section titled “namespace”Type:
String· requiredThe namespace of the key
Type:
String· required · max length: 255The key name
isGlobPattern
Section titled “isGlobPattern”Type:
Boolean· default:falseWhether the key is a glob pattern
JMAP API
Section titled “JMAP API”The MemoryLookupKey object is available via the urn:stalwart:jmap capability.
x:MemoryLookupKey/get
Section titled “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
Section titled “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
Section titled “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": { "key": "Example", "namespace": "Example" } } }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'Update
Section titled “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
Section titled “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
Section titled “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):
| Condition | Kind |
|---|---|
namespace | text |
stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.
stalwart-cli get MemoryLookupKey id1Create
Section titled “Create”stalwart-cli create MemoryLookupKey \ --field namespace=Example \ --field key=Examplestalwart-cli query MemoryLookupKeystalwart-cli query MemoryLookupKey --where namespace=exampleUpdate
Section titled “Update”stalwart-cli update MemoryLookupKey id1 --field namespace='updated value'Delete
Section titled “Delete”stalwart-cli delete MemoryLookupKey --ids id1