mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2024-11-27 08:09:55 +08:00
[Rspamd] domain-wide-footer add jinja templating
This commit is contained in:
parent
f295b8cd91
commit
5ae9605e77
@ -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 = {}
|
||||
|
Loading…
Reference in New Issue
Block a user