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] Move monitoring hosts to monitoring_nolog.map file

c9f455a2
andryyy <[email protected]> 6 years ago
data/conf/rspamd/custom/monitoring_nolog.map | 6 ++++++
 data/conf/rspamd/lua/rspamd.local.lua        | 7 ++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)
 create mode 100644 data/conf/rspamd/custom/monitoring_nolog.map

Diff

diff --git a/data/conf/rspamd/custom/monitoring_nolog.map b/data/conf/rspamd/custom/monitoring_nolog.map
new file mode 100644
index 00000000..a997e786
--- /dev/null
+++ b/data/conf/rspamd/custom/monitoring_nolog.map
@@ -0,0 +1,6 @@
+# Skip logging for these addresses
+/[email protected]/i
+/[email protected]/i
+/watchdog@localhost/i
+/[email protected]/i
+/[email protected]/i
diff --git a/data/conf/rspamd/lua/rspamd.local.lua b/data/conf/rspamd/lua/rspamd.local.lua
index 204cc10f..352853bc 100644
--- a/data/conf/rspamd/lua/rspamd.local.lua
+++ b/data/conf/rspamd/lua/rspamd.local.lua
@@ -7,6 +7,11 @@ rspamd_config.MAILCOW_AUTH = {
 	end
 }
 
+local monitoring_hosts = rspamd_config:add_map{
+  url = "/etc/rspamd/custom/monitoring_nolog.map",
+  description = "Monitoring hosts",
+  type = "regexp"
+}
 
 rspamd_config:register_symbol({
   name = 'KEEP_SPAM',
@@ -203,7 +208,7 @@ rspamd_config:register_symbol({
   type = 'postfilter',
   callback = function(task)
     local from = task:get_header('From')
-    if from and (string.find(from, '[email protected]', 1, true) or string.find(from, '[email protected]', 1, true) or from == 'watchdog@localhost') then
+    if from and monitoring_hosts:get_key(from) then
       task:set_flag('no_log')
       task:set_flag('no_stat')
     end