NobGit
public nobgit read

NobMail

Based on mailcow: dockerized

Languages

Repository composition by tracked source files.

PHP
PHP 49% JavaScript 35% HTML 9% CSS 4% Shell 2% Python 1% Lua 0% Perl 0% Ruby 0% SCSS 0%
Create file Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git

Commit

[Rspamd] domain-wide-footer add jinja templating

5ae9605e
FreddleSpl0it <[email protected]> 2 years, 10 months ago
data/conf/rspamd/lua/rspamd.local.lua | 10 ++++++++++
 1 file changed, 10 insertions(+)

Diff

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 = {}