diff options
author | Carsten Rosenberg <c.rosenberg@heinlein-support.de> | 2019-01-18 14:33:38 +0100 |
---|---|---|
committer | Carsten Rosenberg <c.rosenberg@heinlein-support.de> | 2019-01-18 14:33:38 +0100 |
commit | 4d152f93625f6a9249bb2f9a4e1c5e19227f7029 (patch) | |
tree | 6276ced3dd06d4dafc2697f01c32cbbb42cff941 /lualib/lua_scanners/clamav.lua | |
parent | 968d92d048430fd26ad86e741c7e73d83a9c1ca7 (diff) | |
download | rspamd-4d152f93625f6a9249bb2f9a4e1c5e19227f7029.tar.gz rspamd-4d152f93625f6a9249bb2f9a4e1c5e19227f7029.zip |
[Minor] lua_scanners - use pattern for FAIL symbol
Diffstat (limited to 'lualib/lua_scanners/clamav.lua')
-rw-r--r-- | lualib/lua_scanners/clamav.lua | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lualib/lua_scanners/clamav.lua b/lualib/lua_scanners/clamav.lua index 0f97028ea..b3a1b20f2 100644 --- a/lualib/lua_scanners/clamav.lua +++ b/lualib/lua_scanners/clamav.lua @@ -117,7 +117,7 @@ local function clamav_check(task, content, digest, rule) }) else rspamd_logger.errx(task, '%s: failed to scan, maximum retransmits exceed', rule.log_prefix) - task:insert_result(rule['symbol_fail'], 0.0, 'failed to scan and retransmits exceed') + common.yield_result(task, rule, 'failed to scan and retransmits exceed', 0.0, 'fail') end else @@ -136,12 +136,18 @@ local function clamav_check(task, content, digest, rule) end else local vname = string.match(data, 'stream: (.+) FOUND') - if vname then + if string.find(vname, '^Heuristics%.Encrypted') then + rspamd_logger.errx(task, '%s: File is encrypted', rule.log_prefix) + common.yield_result(task, rule, 'File is encrypted: '.. vname, 0.0, 'fail') + elseif string.find(vname, '^Heuristics%.Limits%.Exceeded') then + rspamd_logger.errx(task, '%s: ClamAV Limits Exceeded', rule.log_prefix) + common.yield_result(task, rule, 'Limits Exceeded: '.. vname, 0.0, 'fail') + elseif vname then common.yield_result(task, rule, vname) cached = vname else rspamd_logger.errx(task, '%s: unhandled response: %s', rule.log_prefix, data) - task:insert_result(rule['symbol_fail'], 0.0, 'unhandled response') + common.yield_result(task, rule, 'unhandled response:' .. vname, 0.0, 'fail') end end if cached then |