]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] More rework in renaming rmilter -> milter
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 2 Jun 2017 14:48:45 +0000 (15:48 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 2 Jun 2017 14:53:34 +0000 (15:53 +0100)
conf/modules.d/milter_headers.conf [moved from conf/modules.d/rmilter_headers.conf with 70% similarity]
src/plugins/lua/milter_headers.lua [moved from src/plugins/lua/rmilter_headers.lua with 97% similarity]

similarity index 70%
rename from conf/modules.d/rmilter_headers.conf
rename to conf/modules.d/milter_headers.conf
index 432057e0315c64e7ea65ae2356d664595af83e81..49eef690804d025328a30e534c91f539b94b12d9 100644 (file)
 
 rmilter_headers {
 
-  # Refer to https://rspamd.com/doc/modules/rmilter_headers.html for information on configuration
+  # Refer to https://rspamd.com/doc/modules/milter_headers.html for information on configuration
 
   use = [];
 
+  # Compatibility
   .include(try=true,priority=5) "${DBDIR}/dynamic/rmilter_headers.conf"
   .include(try=true,priority=1,duplicate=merge) "$LOCAL_CONFDIR/local.d/rmilter_headers.conf"
   .include(try=true,priority=10) "$LOCAL_CONFDIR/override.d/rmilter_headers.conf"
+
+  .include(try=true,priority=5) "${DBDIR}/dynamic/milter_headers.conf"
+  .include(try=true,priority=1,duplicate=merge) "$LOCAL_CONFDIR/local.d/milter_headers.conf"
+  .include(try=true,priority=10) "$LOCAL_CONFDIR/override.d/milter_headers.conf"
 }
similarity index 97%
rename from src/plugins/lua/rmilter_headers.lua
rename to src/plugins/lua/milter_headers.lua
index 76002b70818a2883a2c9932d222721974ddd931d..7447cd208f2234133ed8d50ce25dcd5883944854 100644 (file)
@@ -23,7 +23,7 @@ end
 
 local logger = require "rspamd_logger"
 local util = require "rspamd_util"
-local N = 'rmilter_headers'
+local N = 'milter_headers'
 local E = {}
 
 local HOSTNAME = util.get_hostname()
@@ -103,7 +103,7 @@ local settings = {
 local active_routines = {}
 local custom_routines = {}
 
-local function rmilter_headers(task)
+local function milter_headers(task)
 
   local routines, common, add, remove = {}, {}, {}, {}
 
@@ -303,15 +303,16 @@ local function rmilter_headers(task)
   if not next(add) then add = nil end
   if not next(remove) then remove = nil end
   if add or remove then
-    task:set_rmilter_reply({
+    task:set_milter_reply({
       add_headers = add,
       remove_headers = remove
     })
   end
 end
 
-local opts = rspamd_config:get_all_opt(N)
+local opts = rspamd_config:get_all_opt(N) or rspamd_config:get_all_opt('rmilter_headers')
 if not opts then return end
+
 if type(opts['use']) == 'string' then
   opts['use'] = {opts['use']}
 elseif (type(opts['use']) == 'table' and not opts['use'][1]) then
@@ -362,8 +363,8 @@ if (#active_routines < 1) then
 end
 logger.infox(rspamd_config, 'active routines [%s]', table.concat(active_routines, ','))
 rspamd_config:register_symbol({
-  name = 'RMILTER_HEADERS',
+  name = 'MILTER_HEADERS',
   type = 'postfilter',
-  callback = rmilter_headers,
+  callback = milter_headers,
   priority = 10
 })