From e99db685e57c4bb191ee8073232064e4f134edad Mon Sep 17 00:00:00 2001 From: andryyy Date: Sat, 20 May 2017 14:28:05 +0200 Subject: [PATCH] Change map watch interval, remove Mraptor --- data/conf/rspamd/local.d/options.inc | 1 + data/conf/rspamd/lua/rspamd.local.lua | 35 --------------------------- 2 files changed, 1 insertion(+), 35 deletions(-) diff --git a/data/conf/rspamd/local.d/options.inc b/data/conf/rspamd/local.d/options.inc index 87dc8770..cd358293 100644 --- a/data/conf/rspamd/local.d/options.inc +++ b/data/conf/rspamd/local.d/options.inc @@ -1,3 +1,4 @@ dns { enable_dnssec = true; } +map_watch_interval = 15s \ No newline at end of file diff --git a/data/conf/rspamd/lua/rspamd.local.lua b/data/conf/rspamd/lua/rspamd.local.lua index 43c272d6..0e5c1065 100644 --- a/data/conf/rspamd/lua/rspamd.local.lua +++ b/data/conf/rspamd/lua/rspamd.local.lua @@ -65,38 +65,3 @@ rspamd_config:register_symbol({ }) end -rspamd_config.MRAPTOR = { - callback = function(task) - local parts = task:get_parts() - local rspamd_logger = require "rspamd_logger" - local rspamd_regexp = require "rspamd_regexp" - - if parts then - for _,p in ipairs(parts) do - local mtype,subtype = p:get_type() - local re = rspamd_regexp.create_cached('/(office|word|excel)/i') - if re:match(subtype) then - local content = tostring(p:get_content()) - local filename = p:get_filename() - - local file = os.tmpname() - f = io.open(file, "a+") - f:write(content) - f:close() - - local scan = assert(io.popen('PATH=/usr/bin:/usr/local/bin mraptor ' .. file .. '> /dev/null 2>&1; echo $?', 'r')) - local result = scan:read('*all') - local exit_code = string.match(result, "%d+") - rspamd_logger.infox(exit_code) - scan:close() - - if exit_code == "20" then - rspamd_logger.infox("Reject dangerous macro in office file " .. filename) - task:set_pre_result(rspamd_actions['reject'], 'Dangerous macro in office file ' .. filename) - end - - end - end - end - end -}