]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Fix setting of score for parts differ
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 28 Apr 2016 12:07:06 +0000 (13:07 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 28 Apr 2016 17:03:24 +0000 (18:03 +0100)
rules/misc.lua

index 2c6d503179ca438218fcd2e719ce5ac6b50d3283..68a64f7befc34ff0e3190c6849b323f9f9638a06 100644 (file)
@@ -42,12 +42,13 @@ rspamd_config.R_PARTS_DIFFER = function(task)
       local tw = task:get_mempool():get_variable('total_words', 'int')
 
       if tw then
+        local score
         if tw > 30 then
           -- We are confident about difference
-          local score = (nd - 0.5) * 2.0
+          score = (nd - 0.5) * 2.0
         else
           -- We are not so confident about difference
-          local score = (nd - 0.5)
+          score = (nd - 0.5)
         end
         task:insert_result('R_PARTS_DIFFER', score, tostring(100.0 * nd) .. '%')
       end