SieveSystemScript
Defines a system Sieve script executed by the server.
This object can be configured from the WebUI under Settings › Sieve › System Scripts
Fields
name
Type:
String· requiredName of the script
description
Type:
String?Description of the script
isActive
Type:
Boolean· default:falseWhether the script is active
contents
Type:
Text· requiredContent of the script
JMAP API
The SieveSystemScript object is available via the urn:stalwart:jmap capability.
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
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 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",
"description": "Example",
"isActive": false,
"name": "Example"
}
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'
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
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
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 |
CLI
stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.
Fetch
stalwart-cli get sieve-system-script id1
Create
stalwart-cli create sieve-system-script \
--field name=Example \
--field description=Example \
--field isActive=false \
--field contents=Example
Query
stalwart-cli query sieve-system-script
stalwart-cli query sieve-system-script --where name=example
Update
stalwart-cli update sieve-system-script id1 --field description='Updated'
Delete
stalwart-cli delete sieve-system-script --ids id1