Explorar o código

rspamd: exclude Mail Flow monitoring from logs and stats

Michael Kuron %!s(int64=8) %!d(string=hai) anos
pai
achega
a411a357b9
Modificáronse 1 ficheiros con 13 adicións e 1 borrados
  1. 13 1
      data/conf/rspamd/lua/rspamd.local.lua

+ 13 - 1
data/conf/rspamd/lua/rspamd.local.lua

@@ -107,4 +107,16 @@ rspamd_config:register_symbol({
     return true
   end,
   priority = 20
-})
+})
+
+rspamd_config:register_symbol({
+  name = 'NO_LOG_STAT_MAILFLOW',
+  type = 'postfilter',
+  callback = function(task)
+    local sender = task:get_header('From')
+    if sender == '[email protected]' then
+      task:set_flag('no_log')
+      task:set_flag('no_stat')
+    end
+  end
+})