Skip to content

SpamSettings

Configures global spam filter thresholds, greylisting, and trust settings.

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

Type: Boolean · default: true

Never classify messages as spam if they are sent from addresses present in the user’s address book.

Type: Boolean · default: true

Whether to enable the spam filter

Type: Duration?

Time to keep an IP address in the grey list. The grey list is used to delay messages from unknown senders.

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

Discard messages with a score above this threshold

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

Reject messages with a score above this threshold

Type: Float · default: 5 · max: 100 · min: -100

Mark as Spam messages with a score above this threshold

Type: Boolean · default: true

Never classify messages as spam if they are replies to messages sent by the recipient.

Type: Uri? · default: "https://github.com/stalwartlabs/spam-filter/releases/latest/download/spam-filter-rules.json.gz"

URL to download spam filter rules from

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

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 sysSpamSettingsGet permission.

Terminal window
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:SpamSettings/get",
{
"ids": [
"singleton"
]
},
"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.

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

This method requires the sysSpamSettingsUpdate permission.

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

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

Terminal window
stalwart-cli get SpamSettings
Terminal window
stalwart-cli update SpamSettings --field trustContacts=true