SpamTag
SpamTag
Section titled “SpamTag”Defines a score or action assigned to a spam classification tag.
This object can be configured from the WebUI under Settings › Spam Filter › Scores
Fields
Section titled “Fields”SpamTag is a multi-variant object: each instance has an @type discriminator selecting one of the variants below, and each variant carries its own set of fields.
@type: "Score"
Section titled “@type: "Score"”Assign Score
Type:
String· requiredThe spam tag name
Type:
Float· default:0· min: -999999 · max: 999999The score for the tag
@type: "Discard"
Section titled “@type: "Discard"”Discard
Type:
String· requiredThe spam tag name
@type: "Reject"
Section titled “@type: "Reject"”Reject
Type:
String· requiredThe spam tag name
JMAP API
Section titled “JMAP API”The SpamTag object is available via the urn:stalwart:jmap capability.
x:SpamTag/get
Section titled “x:SpamTag/get”This is a standard Foo/get method as defined in RFC 8620, Section 5.1.
This method requires the sysSpamTagGet permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:SpamTag/get", { "ids": [ "id1" ] }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'x:SpamTag/set
Section titled “x:SpamTag/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 sysSpamTagCreate permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:SpamTag/set", { "create": { "new1": { "@type": "Score", "tag": "Example" } } }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'Update
Section titled “Update”This operation requires the sysSpamTagUpdate permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:SpamTag/set", { "update": { "id1": { "tag": "updated value" } } }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'Destroy
Section titled “Destroy”This operation requires the sysSpamTagDestroy permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:SpamTag/set", { "destroy": [ "id1" ] }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'x:SpamTag/query
Section titled “x:SpamTag/query”This is a standard Foo/query method as defined in RFC 8620, Section 5.5.
This method requires the sysSpamTagQuery permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:SpamTag/query", { "filter": { "tag": "example" } }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'The x:SpamTag/query filter argument accepts the following conditions (combinable with AnyOf / AllOf / Not per RFC 8620):
| Condition | Kind |
|---|---|
tag | text |
stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.
stalwart-cli get SpamTag id1Create
Section titled “Create”stalwart-cli create SpamTag/Score \ --field tag=Examplestalwart-cli query SpamTagstalwart-cli query SpamTag --where tag=exampleUpdate
Section titled “Update”stalwart-cli update SpamTag id1 --field tag='updated value'Delete
Section titled “Delete”stalwart-cli delete SpamTag --ids id1