]> source.dussan.org Git - rspamd.git/commitdiff
Handling ACC messages for sophos
authorMB <mb@nts.ch>
Mon, 3 Apr 2017 10:55:02 +0000 (12:55 +0200)
committerMB <mb@nts.ch>
Mon, 3 Apr 2017 10:55:02 +0000 (12:55 +0200)
src/plugins/lua/antivirus.lua

index 04ef394a2f6f9907948719ad522877dab8303371..ed06e47961cf8433d3062b94a9eaf9e9c6faf878 100644 (file)
@@ -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