]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Do not pollute symbol options with (long) filenames 706/head
authorAlexander Moisseev <moiseev@mezonplus.ru>
Thu, 7 Jul 2016 07:43:04 +0000 (10:43 +0300)
committerAlexander Moisseev <moiseev@mezonplus.ru>
Thu, 7 Jul 2016 07:43:04 +0000 (10:43 +0300)
src/plugins/lua/mime_types.lua

index 50f99e04546c2db14ab42091beadca7a90339b94..a4194a6049cf4b09bd5b62c8253dc456b87dec33 100644 (file)
@@ -88,11 +88,11 @@ local function check_mime_type(task)
           and not string.match(parts[#parts - 1], '^%d+$') then
           -- Double extension + bad extension == VERY bad
           task:insert_result(settings['symbol_double_extension'], badness_mult, {
-            parts[#parts - 1], parts[#parts]
+            parts[#parts - 1], ext
           })
         else
           -- Just bad extension
-          task:insert_result(settings['symbol_bad_extension'], badness_mult, fname)
+          task:insert_result(settings['symbol_bad_extension'], badness_mult, ext)
         end
       end
 
@@ -107,7 +107,7 @@ local function check_mime_type(task)
 
         if settings['archive_extensions'][ext] then
           -- Archive in archive
-          task:insert_result(settings['symbol_archive_in_archive'], 1.0, fname)
+          task:insert_result(settings['symbol_archive_in_archive'], 1.0, ext)
         end
       end
 
@@ -128,7 +128,7 @@ local function check_mime_type(task)
         end
 
         if not found  then
-          task:insert_result(settings['symbol_attachment'], 1.0, fname)
+          task:insert_result(settings['symbol_attachment'], 1.0, ext)
         end
       end
     end