summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-04-30 17:50:32 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-04-30 17:50:32 +0100
commit2cf3ff82308ecdc16a70571bf97aa947262be602 (patch)
treed4b48448cf24e68a00a1c55c04a3f7077b23df60
parent460a1c38db02008c5385cc31399350120a3cd7e5 (diff)
downloadrspamd-2cf3ff82308ecdc16a70571bf97aa947262be602.tar.gz
rspamd-2cf3ff82308ecdc16a70571bf97aa947262be602.zip
[Feature] Implement stop symbols for Clickhouse collection
-rw-r--r--src/plugins/lua/clickhouse.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/plugins/lua/clickhouse.lua b/src/plugins/lua/clickhouse.lua
index edfd3bc0d..82762edfe 100644
--- a/src/plugins/lua/clickhouse.lua
+++ b/src/plugins/lua/clickhouse.lua
@@ -48,6 +48,7 @@ local settings = {
dkim_reject_symbols = {'R_DKIM_REJECT'},
dmarc_allow_symbols = {'DMARC_POLICY_ALLOW'},
dmarc_reject_symbols = {'DMARC_POLICY_REJECT', 'DMARC_POLICY_QUARANTINE'},
+ stop_symbols = {},
table = 'rspamd',
attachments_table = 'rspamd_attachments',
urls_table = 'rspamd_urls',
@@ -408,6 +409,14 @@ end
local function clickhouse_collect(task)
if not settings.allow_local and rspamd_lua_utils.is_rspamc_or_controller(task) then return end
+
+ for _,sym in ipairs(settings.stop_symbols) do
+ if task:has_symbol(sym) then
+ rspamd_logger.debugm(N, task, 'skip collection as symbol %s has fired', sym)
+ return
+ end
+ end
+
local from_domain = ''
local from_user = ''
if task:has_from('smtp') then