From 5ae9605e7747d2588609f9b34245264c03a811ac Mon Sep 17 00:00:00 2001 From: FreddleSpl0it Date: Tue, 12 Sep 2023 12:19:46 +0200 Subject: [PATCH] [Rspamd] domain-wide-footer add jinja templating --- data/conf/rspamd/lua/rspamd.local.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/data/conf/rspamd/lua/rspamd.local.lua b/data/conf/rspamd/lua/rspamd.local.lua index 3d471600..eb1659b3 100644 --- a/data/conf/rspamd/lua/rspamd.local.lua +++ b/data/conf/rspamd/lua/rspamd.local.lua @@ -505,6 +505,7 @@ rspamd_config:register_symbol({ type = 'prefilter', callback = function(task) local lua_mime = require "lua_mime" + local lua_util = require "lua_util" local rspamd_logger = require "rspamd_logger" local rspamd_redis = require "rspamd_redis" local ucl = require "ucl" @@ -542,6 +543,15 @@ rspamd_config:register_symbol({ if footer and type(footer) == "table" and (footer.html or footer.plain) then rspamd_logger.infox(rspamd_config, "found domain wide footer for user %s: html=%s, plain=%s", uname, footer.html, footer.plain) + local replacements = { + email = uname + } + if footer.html then + footer.html = lua_util.jinja_template(footer.html, replacements, true) + end + if footer.plain then + footer.plain = lua_util.jinja_template(footer.plain, replacements, true) + end -- add footer local out = {}