]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Antivirus - workaround for removed attachments_only
authorCarsten Rosenberg <c.rosenberg@heinlein-support.de>
Fri, 28 Sep 2018 08:24:26 +0000 (10:24 +0200)
committerCarsten Rosenberg <c.rosenberg@heinlein-support.de>
Fri, 28 Sep 2018 08:24:26 +0000 (10:24 +0200)
src/plugins/lua/antivirus.lua

index 047035fc111652d72dd5e2c6e5416a423c6bb352..760a26dcc9cce7b791b617614d7d17641ee6b0d2 100644 (file)
@@ -829,6 +829,14 @@ local function add_antivirus_rule(sym, opts)
     opts['symbol_fail'] = string.upper(opts['type']) .. '_FAIL'
   end
 
+  -- WORKAROUND for deprecated attachments_only
+  if opts['attachments_only'] ~= nil then
+    opts['scan_mime_parts'] = opts['attachments_only']
+    rspamd_logger.warnx(rspamd_config, '%s [%s]: Using attachments_only is deprecated. '..
+     'Please use scan_mime_parts = %s instead', opts['symbol'], opts['type'], opts['attachments_only'])
+  end
+  -- WORKAROUND for deprecated attachments_only
+
   if not cfg then
     rspamd_logger.errx(rspamd_config, 'unknown antivirus type: %s',
       opts['type'])