]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Make X-Rspamd-Server configurable 3273/head
authorAlexander Moisseev <moiseev@mezonplus.ru>
Sat, 22 Feb 2020 07:19:46 +0000 (10:19 +0300)
committerAlexander Moisseev <moiseev@mezonplus.ru>
Sat, 22 Feb 2020 07:19:46 +0000 (10:19 +0300)
src/plugins/lua/milter_headers.lua

index 982b07dd0fa6445c77eafacad4dae7d7cf652f4f..0304b863a228855b4118998bc23a0384cbf59a7b 100644 (file)
@@ -56,6 +56,7 @@ local settings = {
     ['x-rspamd-server'] = {
       header = 'X-Rspamd-Server',
       remove = 0,
+      hostname = nil, -- Get the local computer host name
     },
     ['x-rspamd-queue-id'] = {
       header = 'X-Rspamd-Queue-Id',
@@ -295,7 +296,8 @@ local function milter_headers(task)
     if settings.routines['x-rspamd-server'].remove then
       remove[settings.routines['x-rspamd-server'].header] = settings.routines['x-rspamd-server'].remove
     end
-    add[settings.routines['x-rspamd-server'].header] = HOSTNAME
+    local hostname = settings.routines['x-rspamd-server'].hostname
+    add[settings.routines['x-rspamd-server'].header] = hostname and hostname or HOSTNAME
   end
 
   routines['x-spamd-bar'] = function()