aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-10-28 14:17:48 +0200
committerGitHub <noreply@github.com>2016-10-28 14:17:48 +0200
commit35977ee8cf680e6684fea9b3029a9d3a57d5951d (patch)
tree6bd372d39e62e498272cfab375488df46e6ef3b3 /src
parent0bd145a9ac742764af8214ec1a532d1f8317f735 (diff)
parentf12c19b7b68c5fd7db6ba7297b334dc50881423e (diff)
downloadrspamd-35977ee8cf680e6684fea9b3029a9d3a57d5951d.tar.gz
rspamd-35977ee8cf680e6684fea9b3029a9d3a57d5951d.zip
Merge pull request #1076 from AlexeySa/patch-5
[Minor] Greylist first message with invalid MX
Diffstat (limited to 'src')
-rw-r--r--src/plugins/lua/mx_check.lua12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/plugins/lua/mx_check.lua b/src/plugins/lua/mx_check.lua
index bf38f63c6..be13a1322 100644
--- a/src/plugins/lua/mx_check.lua
+++ b/src/plugins/lua/mx_check.lua
@@ -28,6 +28,7 @@ local settings = {
symbol_good_mx = 'MX_GOOD',
expire = 86400, -- 1 day by default
expire_novalid = 7200, -- 2 hours by default for no valid mxes
+ greylist_invalid = false, -- Greylist first message with invalid MX (require greylist plugin)
key_prefix = 'rmx'
}
local redis_params
@@ -67,7 +68,16 @@ local function mx_check(task)
end
end
if not valid then
- task:insert_result(settings.symbol_bad_mx, 1.0)
+ -- Greylist message
+ if settings.greylist_invalid then
+ local grey_is_whitelisted = task:get_mempool():get_variable("grey_whitelisted")
+ if not grey_is_whitelisted then
+ task:get_mempool():set_variable("grey_greylisted_required", "1")
+ task:insert_result(settings.symbol_bad_mx, 1.0, "greylisted")
+ end
+ else
+ task:insert_result(settings.symbol_bad_mx, 1.0)
+ end
local ret,_,_ = rspamd_redis_make_request(task,
redis_params, -- connect params
key, -- hash key