diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2023-08-07 11:41:28 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2023-08-07 11:41:28 +0100 |
commit | 662145d0554de5e769b92dab2d41173a98adcee5 (patch) | |
tree | ec28311a0bce6181f248ba7b50304293ad764e44 /src/plugins/lua/dcc.lua | |
parent | bbd88232db43d18f5e0de5a6502848d4074621c5 (diff) | |
download | rspamd-662145d0554de5e769b92dab2d41173a98adcee5.tar.gz rspamd-662145d0554de5e769b92dab2d41173a98adcee5.zip |
[Minor] Reformat all Lua code, no functional changes
Diffstat (limited to 'src/plugins/lua/dcc.lua')
-rw-r--r-- | src/plugins/lua/dcc.lua | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/src/plugins/lua/dcc.lua b/src/plugins/lua/dcc.lua index 4cbe301e0..850832057 100644 --- a/src/plugins/lua/dcc.lua +++ b/src/plugins/lua/dcc.lua @@ -25,20 +25,19 @@ local lua_util = require "lua_util" local rspamd_logger = require "rspamd_logger" local dcc = require("lua_scanners").filter('dcc').dcc - if confighelp then rspamd_config:add_example(nil, 'dcc', - "Check messages for 'bulkiness' using DCC", - [[ -dcc { - socket = "/var/dcc/dccifd"; # Unix socket - servers = "127.0.0.1:10045" # OR TCP upstreams - timeout = 2s; # Timeout to wait for checks - body_max = 999999; # Bulkness threshold for body - fuz1_max = 999999; # Bulkness threshold for fuz1 - fuz2_max = 999999; # Bulkness threshold for fuz2 -} -]]) + "Check messages for 'bulkiness' using DCC", + [[ + dcc { + socket = "/var/dcc/dccifd"; # Unix socket + servers = "127.0.0.1:10045" # OR TCP upstreams + timeout = 2s; # Timeout to wait for checks + body_max = 999999; # Bulkness threshold for body + fuz1_max = 999999; # Bulkness threshold for fuz1 + fuz2_max = 999999; # Bulkness threshold for fuz2 + } + ]]) return end @@ -53,18 +52,22 @@ end -- WORKAROUND for deprecated host and port settings if opts['host'] ~= nil and opts['port'] ~= nil then opts['servers'] = opts['host'] .. ':' .. opts['port'] - rspamd_logger.warnx(rspamd_config, 'Using host and port parameters is deprecated. '.. - 'Please use servers = "%s:%s"; instead', opts['host'], opts['port']) + rspamd_logger.warnx(rspamd_config, 'Using host and port parameters is deprecated. ' .. + 'Please use servers = "%s:%s"; instead', opts['host'], opts['port']) end if opts['host'] ~= nil and not opts['port'] then opts['socket'] = opts['host'] - rspamd_logger.warnx(rspamd_config, 'Using host parameters is deprecated. '.. - 'Please use socket = "%s"; instead', opts['host']) + rspamd_logger.warnx(rspamd_config, 'Using host parameters is deprecated. ' .. + 'Please use socket = "%s"; instead', opts['host']) end -- WORKAROUND for deprecated host and port settings -if not opts.symbol_bulk then opts.symbol_bulk = symbol_bulk end -if not opts.symbol then opts.symbol = symbol end +if not opts.symbol_bulk then + opts.symbol_bulk = symbol_bulk +end +if not opts.symbol then + opts.symbol = symbol +end rule = dcc.configure(opts) @@ -74,17 +77,17 @@ if rule then callback = check_dcc, type = 'callback', }) - rspamd_config:register_symbol{ + rspamd_config:register_symbol { type = 'virtual', parent = id, name = opts.symbol } - rspamd_config:register_symbol{ + rspamd_config:register_symbol { type = 'virtual', parent = id, name = opts.symbol_bulk } - rspamd_config:register_symbol{ + rspamd_config:register_symbol { type = 'virtual', parent = id, name = 'DCC_FAIL' |