Overview
The spam filter is enabled by default in Stalwart. The global on/off switch is the enable field on the SpamSettings singleton (found in the WebUI under Settings › Spam Filter › General). For per-session control, use enableSpamFilter on MtaStageData, which accepts an expression and is evaluated at the SMTP DATA stage.
Scores
As described in the tags and scores section, the spam filter analyses each incoming message and produces a set of tags. Each tag contributes a score (positive values push the message toward spam, negative values toward ham), or triggers a direct discard or reject action. The cumulative score determines the final classification.
MIME types
File-extension classification lets the spam filter react to message attachments in an informed way, based on the expected MIME type of each extension and a small set of flags. Each classification is stored as a SpamFileExtension object (found in the WebUI under Settings › Spam Filter › Lists › File Extensions).
Domain lists
Several of the lookup lists used by the spam filter categorise domains according to their behaviour. These lists inform rule evaluation and allow the filter to react differently to messages involving specific kinds of domain.