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/maillist.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/maillist.lua')
-rw-r--r-- | src/plugins/lua/maillist.lua | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/plugins/lua/maillist.lua b/src/plugins/lua/maillist.lua index 023867a8d..be1401c32 100644 --- a/src/plugins/lua/maillist.lua +++ b/src/plugins/lua/maillist.lua @@ -104,7 +104,8 @@ local function check_ml_mailman(task) -- not much elase we can check, Subjects can be changed in settings return true end - else -- Mailman 3 + else + -- Mailman 3 -- XXX not Mailman3 admin messages have this headers, but one -- which don't usually have List-* headers examined below if task:has_header('List-Administrivia') then @@ -113,7 +114,7 @@ local function check_ml_mailman(task) end -- List-Archive and List-Post are optional, check other headers - for _, h in ipairs({'List-Help', 'List-Subscribe', 'List-Unsubscribe'}) do + for _, h in ipairs({ 'List-Help', 'List-Subscribe', 'List-Unsubscribe' }) do header = task:get_header(h) if not (header and header:find('<mailto:', 1, true)) then return false @@ -173,7 +174,7 @@ local function check_generic_list_headers(task) end, } - for hname,hscore in pairs(common_list_headers) do + for hname, hscore in pairs(common_list_headers) do if task:has_header(hname) then if type(hscore) == 'number' then score = score + hscore @@ -210,7 +211,9 @@ local function check_maillist(task) elseif check_ml_cgp(task) then task:insert_result(symbol, 1, 'cgp') else - if score > 2 then score = 2 end + if score > 2 then + score = 2 + end task:insert_result(symbol, 0.5 * score, 'generic') end end @@ -219,7 +222,7 @@ end -- Configuration -local opts = rspamd_config:get_all_opt('maillist') +local opts = rspamd_config:get_all_opt('maillist') if opts then if opts['symbol'] then symbol = opts['symbol'] |