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?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.
scoreDiscard
Section titled “scoreDiscard”Type:
Float· default:0· max: 100 · min: -100Discard messages with a score at or above this threshold. Set to 0 or below to disable; rejection takes precedence
scoreReject
Section titled “scoreReject”Type:
Float· default:0· max: 100 · min: -100Reject messages with a score at or above this threshold. Set to 0 or below to disable
scoreSpam
Section titled “scoreSpam”Type:
Float· default:5· max: 100 · min: -100Mark as Spam messages with a score at or 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
maxBodyText
Section titled “maxBodyText”Type:
Size· default:262144· min: 1024 · max: 16777216Maximum amount of text analysed from each body text part, the rest is ignored
maxAttachmentText
Section titled “maxAttachmentText”Type:
Size· default:65536· min: 1024 · max: 16777216Maximum amount of text analysed from each non-body text part, such as text attachments
maxMessageText
Section titled “maxMessageText”Type:
Size· default:1048576· min: 1024 · max: 67108864Maximum amount of text analysed per message across all parts
maxRedirectUrls
Section titled “maxRedirectUrls”Type:
UnsignedInt· default:10· max: 1000Maximum number of URL redirector requests sent per message; cached results do not count towards this limit
redirectTimeout
Section titled “redirectTimeout”Type:
Duration· default:5000Time after which a URL redirector request is considered failed
redirectCacheTtl
Section titled “redirectCacheTtl”Type:
Duration· default:86400000Time to cache the destination of a resolved URL redirect
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/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" ] }'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/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.
stalwart-cli get SpamSettingsUpdate
Section titled “Update”stalwart-cli update SpamSettings --field trustContacts=true