diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-06-02 15:48:45 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-06-02 15:53:34 +0100 |
commit | 1dce67d97a586c8556098f2f26709982509af513 (patch) | |
tree | 8471e5e2f15c185b4ffd5994e6968d33a0e21b2a /src/plugins | |
parent | cee0ee2828be1c7e7791fd96401857dca0a60c94 (diff) | |
download | rspamd-1dce67d97a586c8556098f2f26709982509af513.tar.gz rspamd-1dce67d97a586c8556098f2f26709982509af513.zip |
[Minor] More rework in renaming rmilter -> milter
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/lua/milter_headers.lua (renamed from src/plugins/lua/rmilter_headers.lua) | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/plugins/lua/rmilter_headers.lua b/src/plugins/lua/milter_headers.lua index 76002b708..7447cd208 100644 --- a/src/plugins/lua/rmilter_headers.lua +++ b/src/plugins/lua/milter_headers.lua @@ -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 }) |