From: Carsten Rosenberg Date: Tue, 2 Apr 2019 04:38:54 +0000 (+0200) Subject: [Minor] fix some warnings X-Git-Tag: 1.9.1~12^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F2829%2Fhead;p=thirdparty%2Frspamd.git [Minor] fix some warnings --- diff --git a/conf/modules.d/external_services.conf b/conf/modules.d/external_services.conf index a4f9a6aeaf..98c79b4d03 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 a17840305d..d16c1877f4 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 97107c2756..ab39b42e6a 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({