]> source.dussan.org Git - rspamd.git/commitdiff
[Feature] Allow to set headers from settings
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 22 Jul 2017 10:09:35 +0000 (11:09 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 22 Jul 2017 10:09:35 +0000 (11:09 +0100)
src/plugins/lua/settings.lua

index 54b6d65cd7ffc744722c887378ba5ec54582d275..3e8b6d2af8fdcc64ef6326e8c1a74605cfc6067d 100644 (file)
@@ -83,6 +83,14 @@ local function check_query_settings(task)
     local elt = settings_ids[id_str]
     if elt and elt['apply'] then
       task:set_settings(elt['apply'])
+
+      if elt.apply['add_headers'] or elt.apply['remove_headers'] then
+        local rep = {
+          add_headers = elt.apply['add_headers'] or {},
+          remove_headers = elt.apply['remove_headers'] or {},
+        }
+        task:set_rmilter_reply(rep)
+      end
       rspamd_logger.infox(task, "applying settings id %s", id_str)
 
       return true