Skip to main content
Version: 0.16

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 SPAMTRAP. By default, this tag is associated with the Discard action (via a SpamTag object), so messages hitting a trap are dropped silently and never reach a real inbox.

Administrators can change the action associated with the SPAMTRAP 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.