Skip to content

Instantly share code, notes, and snippets.

@c-rosenberg
c-rosenberg / rspamd.lua
Last active February 6, 2024 16:04
Rspamd Lua - check if DKIM domain matches header from domain [Fosdem 2024 talk question]
-- Rspamd Lua - check if DKIM domain matches header from domain [Fosdem 2024 talk question]
-- https://fosdem.org/2024/schedule/event/fosdem-2024-2661--operations-enterprise-mail-security-with-open-source-/
-- set symbol DKIM_EQ_HFROM when at least one of the validated DKIM signature domains
-- match the header from domain
local lua_util = require "lua_util"
local E = {}
rspamd_config:register_symbol{
type = 'callback', -- or virtual, callback, prefilter or postfilter
@c-rosenberg
c-rosenberg / rspamd.lua
Last active February 6, 2024 16:03
Rspamd Lua - match spam with alliteration in from display name, subject and 3 body words
-- Match Spam with alliteration in from display name, subject and 3 body words
-- e.g.
-- MIME From: "Schloemer" <axmyyxb@salebig.pro.ac>
-- Subject: Schutjer
-- Body: Seetaram Sesay Sheker
rspamd_config:register_symbol{
type = 'callback', -- or virtual, callback, prefilter or postfilter
name = 'SPAM_ALLITERATION',
score = 0.0, -- Metric score
<!--
Heinlein Support Quick Install:
Kaspersky Web Traffic Security (kwts)
as ICAP server
for Rspamd
Prerequisites: less, nginx
Download Site: https://support.kaspersky.com/de/kwts6#downloads
Trial License: https://www.kaspersky.de/small-to-medium-business-security/downloads/internet-gateway-free-trial
#
# Sopos SAVDI 2.6 example Config to be used with Rspamd (https://rspamd.com)
#
# Heinlein Support 2018 <support@heinlein-support.de>
#
pidfile: /var/run/savdi.pid
# adjust to local system
user: sophos