SpamSettings
Configures global spam filter thresholds, greylisting, and trust settings.
This object can be configured from the WebUI under Settings › Spam Filter › General
Fields
trustContacts
Type:
Boolean· default:trueNever classify messages as spam if they are sent from addresses present in the user's address book.
enable
Type:
Boolean· default:trueWhether to enable the spam filter
greylistFor
Type:
Duration?Time to keep an IP address in the grey list. The grey list is used to delay messages from unknown senders.
scoreDiscard
Type:
Float· default:0· max: 100 · min: -100Discard messages with a score above this threshold
scoreReject
Type:
Float· default:0· max: 100 · min: -100Reject messages with a score above this threshold
scoreSpam
Type:
Float· default:5· max: 100 · min: -100Mark as Spam messages with a score above this threshold
trustReplies
Type:
Boolean· default:trueNever classify messages as spam if they are replies to messages sent by the recipient.
spamFilterRulesUrl
Type:
Uri?· default:"https://github.com/stalwartlabs/spam-filter/releases/latest/download/spam-filter-rules.json.gz"URL to download spam filter rules from
JMAP API
The SpamSettings singleton is available via the urn:stalwart:jmap capability.
x:SpamSettings/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 sysSpamSettingsGet permission.
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"
]
}'
x:SpamSettings/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 sysSpamSettingsUpdate permission.
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"
]
}'
CLI
stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.
Fetch
stalwart-cli get spam-settings
Update
stalwart-cli update spam-settings --field description='Updated'