From 2f118ada4e5ea26ab6d395346661f713668b099b Mon Sep 17 00:00:00 2001 From: Carsten Rosenberg Date: Tue, 2 Apr 2019 06:38:54 +0200 Subject: [PATCH] [Minor] fix some warnings --- conf/modules.d/external_services.conf | 2 -- lualib/lua_scanners/oletools.lua | 4 ++-- src/plugins/lua/spamtrap.lua | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/conf/modules.d/external_services.conf b/conf/modules.d/external_services.conf index a4f9a6aea..98c79b4d0 100644 --- a/conf/modules.d/external_services.conf +++ b/conf/modules.d/external_services.conf @@ -29,7 +29,6 @@ external_services { # symbol will be yielded if a match is found. If no match is found, default symbol is yielded. patterns { # symbol_name = "pattern"; - JUST_EICAR = "^Eicar-Test-Signature$"; } # mime-part regex matching in content-type or filename mime_parts_filter_regex { @@ -83,7 +82,6 @@ external_services { # symbol will be yielded if a match is found. If no match is found, default symbol is yielded. patterns { # symbol_name = "pattern"; - JUST_EICAR = "^Eicar-Test-Signature$"; } # `whitelist` points to a map of IP addresses. Mail from these addresses is not scanned. whitelist = "/etc/rspamd/antivirus.wl"; diff --git a/lualib/lua_scanners/oletools.lua b/lualib/lua_scanners/oletools.lua index a17840305..d16c1877f 100644 --- a/lualib/lua_scanners/oletools.lua +++ b/lualib/lua_scanners/oletools.lua @@ -130,10 +130,10 @@ local function oletools_check(task, content, digest, rule) rspamd_logger.errx(task, '%s: Error message: %s', rule.log_prefix, result[2]['message']) oletools_requery(oletools_rc[result[3]['return_code']]) - elseif #result[2]['analysis'] == 0 and #result[2]['macros'] == 0 then + elseif type(result[2]['analysis']) == 'table' and #result[2]['analysis'] == 0 and #result[2]['macros'] == 0 then rspamd_logger.warnx(task, '%s: maybe unhandled python or oletools error', rule.log_prefix) common.yield_result(task, rule, 'oletools unhandled error', 0.0, 'fail') - elseif result[2]['analysis'] == 'null' and #result[2]['macros'] == 0 then + elseif type(result[2]['analysis']) ~= 'table' and #result[2]['macros'] == 0 then common.save_av_cache(task, digest, rule, 'OK') common.log_clean(task, rule, 'No macro found') elseif #result[2]['macros'] > 0 then diff --git a/src/plugins/lua/spamtrap.lua b/src/plugins/lua/spamtrap.lua index 97107c275..ab39b42e6 100644 --- a/src/plugins/lua/spamtrap.lua +++ b/src/plugins/lua/spamtrap.lua @@ -184,7 +184,7 @@ if opts then local id = rspamd_config:register_symbol({ name = "SPAMTRAP_CHECK", - type = "postfilter", + type = "callback,postfilter", callback = spamtrap_cb }) rspamd_config:register_symbol({ -- 2.39.5