diff options
author | Andrew Lewis <nerf@judo.za.org> | 2017-02-28 15:29:02 +0200 |
---|---|---|
committer | Andrew Lewis <nerf@judo.za.org> | 2017-02-28 15:29:02 +0200 |
commit | f6657e81090aa77e1e9b7b7274c7f10bfbc2ce57 (patch) | |
tree | 395f970c5c8af4889bccb13921a5c2b88afce45e | |
parent | 3b89fbaaef6fbf0157e69f713232d9aca3cb13b8 (diff) | |
download | rspamd-f6657e81090aa77e1e9b7b7274c7f10bfbc2ce57.tar.gz rspamd-f6657e81090aa77e1e9b7b7274c7f10bfbc2ce57.zip |
[Minor] Fail upstreams in antivirus module
-rw-r--r-- | src/plugins/lua/antivirus.lua | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/plugins/lua/antivirus.lua b/src/plugins/lua/antivirus.lua index ae0cd6b14..c7664f6d1 100644 --- a/src/plugins/lua/antivirus.lua +++ b/src/plugins/lua/antivirus.lua @@ -321,12 +321,14 @@ local function fprot_check(task, rule) }) else rspamd_logger.errx(task, 'failed to scan, maximum retransmits exceed') + upstream:fail() end else rspamd_logger.errx(task, 'failed to scan: %s', err) + upstream:fail() end else - + upstream:ok() data = tostring(data) local found = (string.sub(data, 1, 1) == '1') local cached = 'OK' @@ -385,12 +387,14 @@ local function clamav_check(task, rule) }) else rspamd_logger.errx(task, 'failed to scan, maximum retransmits exceed') + upstream:fail() end else rspamd_logger.errx(task, 'failed to scan: %s', err) + upstream:fail() end else - + upstream:ok() data = tostring(data) local s = string.find(data, ' FOUND') local cached = 'OK' @@ -448,12 +452,14 @@ local function sophos_check(task, rule) }) else rspamd_logger.errx(task, 'failed to scan, maximum retransmits exceed') + upstream:fail() end else rspamd_logger.errx(task, 'failed to scan: %s', err) + upstream:fail() end else - + upstream:ok() data = tostring(data) local vname = string.match(data, 'VIRUS (%S+) ') if vname then @@ -567,12 +573,14 @@ local function savapi_check(task, rule) }) else rspamd_logger.errx(task, 'failed to scan, maximum retransmits exceed') + upstream:fail() end else rspamd_logger.errx(task, 'failed to scan: %s', err) + upstream:fail() end else - + upstream:ok() local result = tostring(data) -- 100 SAVAPI:4.0 greeting |