end
end
+ if rule.dynamic_scan then
+ local pre_check, pre_check_msg = common.check_metric_results(task, rule)
+ if pre_check then
+ rspamd_logger.infox(task, '%s: aborting: %s', rule.log_prefix, pre_check_msg)
+ return true
+ end
+ end
+
tcp.request({
task = task,
host = addr:to_string(),
end
end
+ if rule.dynamic_scan then
+ local pre_check, pre_check_msg = common.check_metric_results(task, rule)
+ if pre_check then
+ rspamd_logger.infox(task, '%s: aborting: %s', rule.log_prefix, pre_check_msg)
+ return true
+ end
+ end
+
tcp.request({
task = task,
host = addr:to_string(),
end
end
+ if rule.dynamic_scan then
+ local pre_check, pre_check_msg = common.check_metric_results(task, rule)
+ if pre_check then
+ rspamd_logger.infox(task, '%s: aborting: %s', rule.log_prefix, pre_check_msg)
+ return true
+ end
+ end
+
tcp.request({
task = task,
host = addr:to_string(),
end
end
+ if rule.dynamic_scan then
+ local pre_check, pre_check_msg = common.check_metric_results(task, rule)
+ if pre_check then
+ rspamd_logger.infox(task, '%s: aborting: %s', rule.log_prefix, pre_check_msg)
+ return true
+ end
+ end
+
tcp.request({
task = task,
host = addr:to_string(),
end
end
+ if rule.dynamic_scan then
+ local pre_check, pre_check_msg = common.check_metric_results(task, rule)
+ if pre_check then
+ rspamd_logger.infox(task, '%s: aborting: %s', rule.log_prefix, pre_check_msg)
+ return true
+ end
+ end
+
tcp.request({
task = task,
host = addr:to_string(),
end
end
+ if rule.dynamic_scan then
+ local pre_check, pre_check_msg = common.check_metric_results(task, rule)
+ if pre_check then
+ rspamd_logger.infox(task, '%s: aborting: %s', rule.log_prefix, pre_check_msg)
+ return true
+ end
+ end
+
tcp.request({
task = task,
host = addr:to_string(),
default_score = 1,
action = false,
extended = false,
+ symbol_type = 'postfilter',
+ dynamic_scan = true,
}
oletools_conf = lua_util.override_defaults(oletools_conf, opts)
end
end
+ if rule.dynamic_scan then
+ local pre_check, pre_check_msg = common.check_metric_results(task, rule)
+ if pre_check then
+ rspamd_logger.infox(task, '%s: aborting: %s', rule.log_prefix, pre_check_msg)
+ return true
+ end
+ end
+
tcp.request({
task = task,
host = addr:to_string(),
retransmits = 2,
cache_expire = 3600, -- expire redis in one hour
message = default_message,
- savdi_report_encrypted = false,
detection_category = "virus",
- savdi_report_oversize = false,
}
sophos_conf = lua_util.override_defaults(sophos_conf, opts)
end
end
+ if rule.dynamic_scan then
+ local pre_check, pre_check_msg = common.check_metric_results(task, rule)
+ if pre_check then
+ rspamd_logger.infox(task, '%s: aborting: %s', rule.log_prefix, pre_check_msg)
+ return true
+ end
+ end
+
tcp.request({
task = task,
host = addr:to_string(),
end
end
+ if rule.dynamic_scan then
+ local pre_check, pre_check_msg = common.check_metric_results(task, rule)
+ if pre_check then
+ rspamd_logger.infox(task, '%s: aborting: %s', rule.log_prefix, pre_check_msg)
+ return true
+ end
+ end
+
tcp.request({
task = task,
host = addr:to_string(),
default_score = 1,
action = false,
extended = false,
+ symbol_type = 'postfilter',
+ dynamic_scan = true,
}
spamassassin_conf = lua_util.override_defaults(spamassassin_conf, opts)
local upstream_list = require "rspamd_upstream_list"
local rspamd_logger = require "rspamd_logger"
local ucl = require "ucl"
+local common = require "lua_scanners/common"
local N = 'vadesecure'
end
end
+ if rule.dynamic_scan then
+ local pre_check, pre_check_msg = common.check_metric_results(task, rule)
+ if pre_check then
+ rspamd_logger.infox(task, '%s: aborting: %s', rule.log_prefix, pre_check_msg)
+ return true
+ end
+ end
+
request_data.callback = vade_callback
http.request(request_data)
end
if not cb then
rspamd_logger.errx(rspamd_config, 'cannot add rule: "' .. k .. '"')
else
- local id = rspamd_config:register_symbol({
- type = 'normal',
- name = m['symbol'],
+
+ local t = {
+ name = m.symbol,
callback = cb,
score = 0.0,
group = N
- })
+ }
+
+ if m.symbol_type == 'postfilter' then
+ t.type = 'postfilter'
+ t.priority = 3
+ else
+ t.type = 'normal'
+ end
+
+ local id = rspamd_config:register_symbol(t)
+
rspamd_config:register_symbol({
type = 'virtual',
name = m['symbol_fail'],
rspamd_logger.errx(rspamd_config, 'cannot add rule: "' .. k .. '"')
else
m = nrule
- local id = rspamd_config:register_symbol({
- type = 'normal',
- name = m['symbol'],
+
+ local t = {
+ name = m.symbol,
callback = cb,
score = 0.0,
group = N
- })
+ }
+
+ if m.symbol_type == 'postfilter' then
+ t.type = 'postfilter'
+ t.priority = 3
+ else
+ t.type = 'normal'
+ end
+
+ local id = rspamd_config:register_symbol(t)
+
rspamd_config:register_symbol({
type = 'virtual',
name = m['symbol_fail'],