]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Store hostname in elastic
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 9 May 2018 11:56:30 +0000 (12:56 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 9 May 2018 11:56:30 +0000 (12:56 +0100)
.idea/perl5local.xml [new file with mode: 0644]
contrib/elastic/rspamd_template.json
src/plugins/lua/elastic.lua

diff --git a/.idea/perl5local.xml b/.idea/perl5local.xml
new file mode 100644 (file)
index 0000000..1ce2600
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Perl5LocalSettings">
+    <option name="DISABLE_ASSOCIATIONS_CHECKING" value="true" />
+  </component>
+</project>
\ No newline at end of file
index c1d11478f95f7db1d28d4ad5757172b757f8d75c..9119af4c709af50c1792d52a208e17801f12c345 100644 (file)
               "ignore_above": 1024,
               "type": "keyword"
             },
+            "hostname": {
+              "ignore_above": 1024,
+              "type": "keyword"
+            },
             "score": {
               "type": "float"
             },
index 854f5ec644840bc7b7d481771b9703d5be44713f..4caedd684899047b912525cca9361e1cab14efc3 100644 (file)
@@ -182,11 +182,15 @@ local function get_general_metadata(task)
       return 'unknown'
     end
   end
+
   r.header_from = process_header('from')
   r.header_to = process_header('to')
   r.header_subject = process_header('subject')
   r.header_date = process_header('date')
   r.message_id = task:get_message_id()
+  local hname = task:get_hostname() or 'unknown'
+  r.hostname = hname
+
   return r
 end