[Rspamd] Move monitoring hosts to monitoring_nolog.map file
parent
684d3cd120
commit
c9f455a2b1
|
@ -0,0 +1,6 @@
|
||||||
|
# Skip logging for these addresses
|
||||||
|
/monitoring-system@everycloudtech.us/i
|
||||||
|
/monitor@tools.mailflowmonitoring.com/i
|
||||||
|
/watchdog@localhost/i
|
||||||
|
/supertool@mxtoolbox.com/i
|
||||||
|
/test@mxtoolboxsmtpdiag.com/i
|
|
@ -7,6 +7,11 @@ rspamd_config.MAILCOW_AUTH = {
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local monitoring_hosts = rspamd_config:add_map{
|
||||||
|
url = "/etc/rspamd/custom/monitoring_nolog.map",
|
||||||
|
description = "Monitoring hosts",
|
||||||
|
type = "regexp"
|
||||||
|
}
|
||||||
|
|
||||||
rspamd_config:register_symbol({
|
rspamd_config:register_symbol({
|
||||||
name = 'KEEP_SPAM',
|
name = 'KEEP_SPAM',
|
||||||
|
@ -203,7 +208,7 @@ rspamd_config:register_symbol({
|
||||||
type = 'postfilter',
|
type = 'postfilter',
|
||||||
callback = function(task)
|
callback = function(task)
|
||||||
local from = task:get_header('From')
|
local from = task:get_header('From')
|
||||||
if from and (string.find(from, 'monitoring-system@everycloudtech.us', 1, true) or string.find(from, 'monitor@tools.mailflowmonitoring.com', 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_log')
|
||||||
task:set_flag('no_stat')
|
task:set_flag('no_stat')
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue