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?

How long a sender and recipient pair is remembered after its first delivery attempt was deferred. Retries for the same pair within this period are accepted; once it expires, the pair is greylisted again. Only applies to unauthenticated sessions. Disabled when unset.

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

Discard messages with a score at or above this threshold. Set to 0 or below to disable; rejection takes precedence

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

Reject messages with a score at or above this threshold. Set to 0 or below to disable

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

Mark as Spam messages with a score at or 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

Type: Size · default: 262144 · min: 1024 · max: 16777216

Maximum amount of text analysed from each body text part, the rest is ignored

Type: Size · default: 65536 · min: 1024 · max: 16777216

Maximum amount of text analysed from each non-body text part, such as text attachments

Type: Size · default: 1048576 · min: 1024 · max: 67108864

Maximum amount of text analysed per message across all parts

Type: UnsignedInt · default: 10 · max: 1000

Maximum number of URL redirector requests sent per message; cached results do not count towards this limit

Type: Duration · default: 5000

Time after which a URL redirector request is considered failed

Type: Duration · default: 86400000

Time to cache the destination of a resolved URL redirect

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/jmap/ \
-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/jmap/ \
-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