Skip to main content
Version: 0.16

SpamLlm

Configures the LLM-based spam classifier.

Enterprise feature

This object is only available with an Enterprise license.

This object can be configured from the WebUI under Settings › Spam Filter › LLM Classifier

Fields

SpamLlm 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: "Disable"

Disabled

@type: "Enable"

Enabled

categories

Type: String[] · default: ["Unsolicited","Commercial","Harmful","Legitimate"] · min items: 2

The expected categories in the LLM response

confidence

Type: String[] · default: ["High","Medium","Low"]

The expected confidence levels in the LLM response

responsePosCategory

Type: UnsignedInt · default: 0

The position of the category field in the LLM response.

responsePosConfidence

Type: UnsignedInt? · default: 1

The position of the confidence field in the LLM response.

responsePosExplanation

Type: UnsignedInt? · default: 2

The position of the explanation field in the LLM response.

modelId

Type: Id<AiModel> · required

The AI model to use for the LLM classifier

prompt

Type: Text · required

The prompt to use for the LLM classifier

separator

Type: String · default: ","

The separator character used to parse the LLM response.

temperature

Type: Float · default: 0.5 · max: 1 · min: 0

The temperature to use for the LLM classifier

JMAP API

The SpamLlm singleton is available via the urn:stalwart:jmap capability.

x:SpamLlm/get

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

For singletons, the ids argument should be the literal singleton (or null to return the single instance).

This method requires the sysSpamLlmGet permission.

curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:SpamLlm/get",
{
"ids": [
"singleton"
]
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

x:SpamLlm/set

This is a standard Foo/set method as defined in RFC 8620, Section 5.3.

For singletons, only the update argument with id singleton is accepted; create and destroy arguments are rejected.

This method requires the sysSpamLlmUpdate permission.

curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:SpamLlm/set",
{
"update": {
"singleton": {
"id": "id1"
}
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

CLI

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

Fetch

stalwart-cli get spam-llm

Update

stalwart-cli update spam-llm --field description='Updated'