Spamtrap module

With the spamtrap module you can catch spam trapped emails or even a catch-all domain.
It is intended for learning bayes spam and, if you run your own fuzzy storage, for learning
a fuzzy flag with a fuzzy weight. You can also add a score for this symbol in the metrics,
if you only want to tag such emails. You can use this later in other modules like
force_actions or metadata_exporter. Examples will be given below.

Spamtrap setup

The spamtrap plugin may either use a map containing regular expressions that represent
email addresses or domains, or Redis, where addresses are stored as keys and values can
be anything. You can use one or the other method. By setting a map parameter, Redis is
automatically turned off.

The first is a full email address, while the second is a catch-all domain.

Advanced: settings_redis example

The following is an example that you can use for the spamtrap module. It will look
in Redis and collect settings for dealing with spam trapped emails or domains. You
can place this in /etc/rspamd/rspamd.conf.local:

Advanced: Adding emails and domains to Redis

There are several way to add emails or domains to the Redis store. One would be to add
it directly with the ‘redis-cli’. But if you have more than one entry to add, a simple
shell script will help you:

We disable certain groups here, as we can speed up tests. We do not ask for RBLs, checking
for viruses or doing some kind of SPF, DKIM and DMARC tests, as most of the spam trapped
emails would already be caught by these rules. Our goal is primarily on learning fuzzy and
bays spam, so we skip these tests. Feel free to add whatever you want.