SpamSettings
SpamSettings
Section titled “SpamSettings”Configures global spam filter thresholds, greylisting, and trust settings.
This object can be configured from the WebUI under Settings › Spam Filter › General
Fields
Section titled “Fields”trustContacts
Section titled “trustContacts”Type:
Boolean· default:trueNever classify messages as spam if they are sent from addresses present in the user’s address book.
enable
Section titled “enable”Type:
Boolean· default:trueWhether to enable the spam filter
greylistFor
Section titled “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
Section titled “scoreDiscard”Type:
Float· default:0· max: 100 · min: -100Discard messages with a score above this threshold
scoreReject
Section titled “scoreReject”Type:
Float· default:0· max: 100 · min: -100Reject messages with a score above this threshold
scoreSpam
Section titled “scoreSpam”Type:
Float· default:5· max: 100 · min: -100Mark as Spam messages with a score above this threshold
trustReplies
Section titled “trustReplies”Type:
Boolean· default:trueNever classify messages as spam if they are replies to messages sent by the recipient.
spamFilterRulesUrl
Section titled “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
Section titled “JMAP API”The SpamSettings singleton is available via the urn:stalwart:jmap capability.
x:SpamSettings/get
Section titled “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
Section titled “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" ] }'stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.
stalwart-cli get SpamSettingsUpdate
Section titled “Update”stalwart-cli update SpamSettings --field trustContacts=true