]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Allow to get invisible content in `rspamadm mime ex`
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 7 Sep 2021 15:35:02 +0000 (16:35 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 7 Sep 2021 15:35:02 +0000 (16:35 +0100)
lualib/rspamadm/mime.lua

index 68dd9e7606adc5501bb6dd046ba32828b8da2e92..0faeeca786c17f58536da973678ce91b68eb9bc9 100644 (file)
@@ -77,6 +77,8 @@ extract:flag "-p --part"
        :description "Show part info"
 extract:flag "-s --structure"
        :description "Show structure info (e.g. HTML tags)"
+extract:flag "-i --invisible"
+       :description "Show invisible content for HTML parts"
 extract:option "-F --words-format"
        :description "Words format ('stem', 'norm', 'raw', 'full')"
        :argname("<type>")
@@ -432,6 +434,11 @@ local function extract_handler(opts)
             else -- opts.structure
               table.insert(out_elts[fname], tostring(part:get_content(how)))
             end
+            if opts.invisible then
+              local hc = part:get_html()
+              table.insert(out_elts[fname], string.format('invisible content: %s',
+                  tostring(hc:get_invisible())))
+            end
           end
         end