Skip to content

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

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.

Assign Score

Type: String · required

The spam tag name

Type: Float · default: 0 · min: -999999 · max: 999999

The score for the tag

Discard

Type: String · required

The spam tag name

Reject

Type: String · required

The spam tag name

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

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

This method requires the sysSpamTagGet permission.

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

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.

This operation requires the sysSpamTagCreate permission.

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

This operation requires the sysSpamTagUpdate permission.

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

This operation requires the sysSpamTagDestroy permission.

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

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

This method requires the sysSpamTagQuery permission.

Terminal window
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):

ConditionKind
tagtext

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

Terminal window
stalwart-cli get SpamTag id1
Terminal window
stalwart-cli create SpamTag/Score \
--field tag=Example
Terminal window
stalwart-cli query SpamTag
stalwart-cli query SpamTag --where tag=example
Terminal window
stalwart-cli update SpamTag id1 --field tag='updated value'
Terminal window
stalwart-cli delete SpamTag --ids id1