aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lua/metadata_exporter.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2022-05-27 21:00:49 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2022-05-27 21:00:49 +0100
commitf015521e4ac67946d322aa4df4fb63a12345e5cc (patch)
treef330337469827f8edb4166165d3b7d3cdf975955 /src/plugins/lua/metadata_exporter.lua
parentac257bca1b9f9a5252f469436e753360eaf016ff (diff)
downloadrspamd-f015521e4ac67946d322aa4df4fb63a12345e5cc.tar.gz
rspamd-f015521e4ac67946d322aa4df4fb63a12345e5cc.zip
[Minor] Remove legacy `default` metric
Diffstat (limited to 'src/plugins/lua/metadata_exporter.lua')
-rw-r--r--src/plugins/lua/metadata_exporter.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/plugins/lua/metadata_exporter.lua b/src/plugins/lua/metadata_exporter.lua
index 6316ddc09..d72454f86 100644
--- a/src/plugins/lua/metadata_exporter.lua
+++ b/src/plugins/lua/metadata_exporter.lua
@@ -75,10 +75,10 @@ local function get_general_metadata(task, flatten, no_content)
r.user = task:get_user() or 'unknown'
r.qid = task:get_queue_id() or 'unknown'
r.subject = task:get_subject() or 'unknown'
- r.action = task:get_metric_action('default')
+ r.action = task:get_metric_action()
r.rspamd_server = HOSTNAME
- local s = task:get_metric_score('default')[1]
+ local s = task:get_metric_score()[1]
r.score = flatten and string.format('%.2f', s) or s
local fuzzy = task:get_mempool():get_variable("fuzzy_hashes", "fstrings")
@@ -238,29 +238,29 @@ local selectors = {
return true
end,
is_spam = function(task)
- local action = task:get_metric_action('default')
+ local action = task:get_metric_action()
return is_spam(action)
end,
is_spam_authed = function(task)
if not task:get_user() then
return false
end
- local action = task:get_metric_action('default')
+ local action = task:get_metric_action()
return is_spam(action)
end,
is_reject = function(task)
- local action = task:get_metric_action('default')
+ local action = task:get_metric_action()
return (action == 'reject')
end,
is_reject_authed = function(task)
if not task:get_user() then
return false
end
- local action = task:get_metric_action('default')
+ local action = task:get_metric_action()
return (action == 'reject')
end,
is_not_soft_reject = function(task)
- local action = task:get_metric_action('default')
+ local action = task:get_metric_action()
return (action ~= 'soft reject')
end,
}