aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2018-01-17 18:48:45 +0200
committerAndrew Lewis <nerf@judo.za.org>2018-01-17 18:49:53 +0200
commit2943cff50867235483976ed004654a2bebe08a59 (patch)
treeb3aebf024436cff4bd5d0c5e5646280ee621b9f5 /src
parent97ab1a1a08ce9eb644adea17943d60582918a13d (diff)
downloadrspamd-2943cff50867235483976ed004654a2bebe08a59.tar.gz
rspamd-2943cff50867235483976ed004654a2bebe08a59.zip
[Minor] Replies: toggles for processing of local/authenticated mail
Diffstat (limited to 'src')
-rw-r--r--src/plugins/lua/replies.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/plugins/lua/replies.lua b/src/plugins/lua/replies.lua
index 5c17efa59..398c7b3f2 100644
--- a/src/plugins/lua/replies.lua
+++ b/src/plugins/lua/replies.lua
@@ -30,6 +30,8 @@ local settings = {
message = 'Message is reply to one we originated',
symbol = 'REPLY',
score = -2, -- Default score
+ use_auth = true,
+ use_local = true,
}
local rspamd_logger = require 'rspamd_logger'
@@ -56,7 +58,7 @@ local function replies_check(task)
task:insert_result(settings['symbol'], 1.0)
if settings['action'] ~= nil then
local ip_addr = task:get_ip()
- if task:get_user() or (ip_addr and ip_addr:is_local()) then
+ if (settings.use_auth and task:get_user()) or (settings.use_local and ip_addr and ip_addr:is_local()) then
rspamd_logger.infox(task, "not forcing action for local network or authorized user");
else
task:set_pre_result(settings['action'], settings['message'])
@@ -94,7 +96,11 @@ local function replies_set(task)
end
-- If sender is unauthenticated return
local ip = task:get_ip()
- if task:get_user() == nil and not (ip and ip:is_local()) then
+ if settings.use_auth and task:get_user() then
+ rspamd_logger.debugm(N, task, 'sender is authenticated')
+ elseif settings.use_local and (ip and ip:is_local()) then
+ rspamd_logger.debugm(N, task, 'sender is from local network')
+ else
return
end
-- If no message-id present return