]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Allow to export local messages scans to clickhouse
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 9 Mar 2018 11:55:41 +0000 (11:55 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 9 Mar 2018 11:55:41 +0000 (11:55 +0000)
src/plugins/lua/clickhouse.lua

index 04d2c6c579d463c753e5c54694e28cf88d3506b2..9ef951e43f20deea3f1759f9d7cb55f89d53e7f6 100644 (file)
@@ -58,6 +58,7 @@ local settings = {
   enable_symbols = false,
   use_https = false,
   use_gzip = true,
+  allow_local = false,
 }
 
 local clickhouse_schema = {
@@ -363,7 +364,7 @@ local function clickhouse_quote(str)
 end
 
 local function clickhouse_collect(task)
-  if rspamd_lua_utils.is_rspamc_or_controller(task) then return end
+  if not settings.allow_local and rspamd_lua_utils.is_rspamc_or_controller(task) then return end
   local from_domain = ''
   local from_user = ''
   if task:has_from('smtp') then