From 302621bc496f0176f4483f6800b471351fec95f1 Mon Sep 17 00:00:00 2001 From: MB Date: Mon, 3 Apr 2017 12:55:02 +0200 Subject: [PATCH] Handling ACC messages for sophos --- src/plugins/lua/antivirus.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/lua/antivirus.lua b/src/plugins/lua/antivirus.lua index 04ef394a2..ed06e4796 100644 --- a/src/plugins/lua/antivirus.lua +++ b/src/plugins/lua/antivirus.lua @@ -450,7 +450,7 @@ local function sophos_check(task, rule) local streamsize = string.format('SCANDATA %d\n', task:get_size()) local bye = 'BYE\n' - local function sophos_callback(err, data) + local function sophos_callback(err, data, conn) if err then if err == 'IO timeout' then if retransmits > 0 then @@ -484,6 +484,8 @@ local function sophos_check(task, rule) rspamd_logger.infox(task, '%s [%s]: message is clean', rule['symbol'], rule['type']) end save_av_cache(task, rule, 'OK') + elseif string.find(data, 'ACC') then + conn:add_read(sophos_callback) else rspamd_logger.errx(task, 'unhandled response: %s', data) end -- 2.39.5