[Rspamd-Users] Spamtraps with tagged addresses

Ralph Seichter abbot at monksofcool.net
Tue Mar 19 16:46:12 UTC 2019


* Philip Paeps:

> That sounds good. But how would I configure that for spamtraps?

Try something along these lines in your /etc/rspamd/rspamd.local.lua:

  rspamd_config:add_condition('EMAIL_PLUS_ALIASES', function(task) return false end)

  rspamd_config.MY_SPAM_TRAP_MATCH = {
    callback = function(task)
      local rcpt = task:get_principal_recipient()
      if rcpt == '<user+spamtrap at domain.tld>' then
        -- Spam trap was triggered
        return true
      end
      return false
    end,
    score = 0.123
  }

Please note that I cannot test this right now for syntactical correctness. Also,
I am not 100% certain if the angular brackets '<...>' around the recipient
address are required, so please consult the docs. Matching can of course also be
done using regular expressions.

-Ralph


More information about the Users mailing list