SieveSystemScript
SieveSystemScript
Section titled “SieveSystemScript”Defines a system Sieve script executed by the server.
This object can be configured from the WebUI under Settings › Sieve › System Scripts
Fields
Section titled “Fields”Type:
String· requiredName of the script
description
Section titled “description”Type:
String?Description of the script
isActive
Section titled “isActive”Type:
Boolean· default:falseWhether the script is active
contents
Section titled “contents”Type:
Text· requiredContent of the script
JMAP API
Section titled “JMAP API”The SieveSystemScript object is available via the urn:stalwart:jmap capability.
x:SieveSystemScript/get
Section titled “x:SieveSystemScript/get”This is a standard Foo/get method as defined in RFC 8620, Section 5.1.
This method requires the sysSieveSystemScriptGet permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:SieveSystemScript/get", { "ids": [ "id1" ] }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'x:SieveSystemScript/set
Section titled “x:SieveSystemScript/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 sysSieveSystemScriptCreate permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:SieveSystemScript/set", { "create": { "new1": { "contents": "Example", "name": "Example" } } }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'Update
Section titled “Update”This operation requires the sysSieveSystemScriptUpdate permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:SieveSystemScript/set", { "update": { "id1": { "name": "updated value" } } }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'Destroy
Section titled “Destroy”This operation requires the sysSieveSystemScriptDestroy permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:SieveSystemScript/set", { "destroy": [ "id1" ] }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'x:SieveSystemScript/query
Section titled “x:SieveSystemScript/query”This is a standard Foo/query method as defined in RFC 8620, Section 5.5.
This method requires the sysSieveSystemScriptQuery permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:SieveSystemScript/query", { "filter": { "name": "example" } }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'The x:SieveSystemScript/query filter argument accepts the following conditions (combinable with AnyOf / AllOf / Not per RFC 8620):
| Condition | Kind |
|---|---|
name | text |
stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.
stalwart-cli get SieveSystemScript id1Create
Section titled “Create”stalwart-cli create SieveSystemScript \ --field name=Example \ --field contents=Examplestalwart-cli query SieveSystemScriptstalwart-cli query SieveSystemScript --where name=exampleUpdate
Section titled “Update”stalwart-cli update SieveSystemScript id1 --field name='updated value'Delete
Section titled “Delete”stalwart-cli delete SieveSystemScript --ids id1