Spamtrap
A spam trap is an email address set up specifically to attract spam. These addresses are not used for regular communication and do not belong to real users, so any message sent to one is, by definition, unsolicited. Spam traps therefore provide a reliable indicator of spam activity.
Beyond flagging individual messages, spam traps also help train and refine the spam classifier. Each message received at a trap address is treated as a clear spam sample; Stalwart can automatically add it to the training data so that the classifier adapts to the latest spam tactics.
The list of spam trap addresses is maintained as an in-memory lookup list entry. Each trap address is a MemoryLookupKey (found in the WebUI under Settings › Lookups › In-Memory Keys, Settings › Spam Filter › Lists › Blocked Domains, Settings › Spam Filter › Lists › Spam Traps, Settings › Spam Filter › Lists › Trusted Domains, Settings › Spam Filter › Lists › URL Redirectors) in the spam-trap namespace. When a delivery matches a configured trap address, the message is tagged with SPAM_TRAP. By default, this tag is associated with a spam score of 15.0 (via a SpamTag object).
To have messages hitting a trap be dropped silently and never reach a real inbox, administrators can change the action associated with the SPAM_TRAP tag by editing the corresponding SpamTag entry under the Spam scores configuration.
Automatic learning from spam traps is controlled by learnSpamFromTraps on the SpamClassifier singleton.