]> source.dussan.org Git - rspamd.git/commitdiff
Another way for greylist "MX_INVALID" message 1076/head
authorAL <AlexeySa@users.noreply.github.com>
Thu, 27 Oct 2016 13:06:31 +0000 (16:06 +0300)
committerGitHub <noreply@github.com>
Thu, 27 Oct 2016 13:06:31 +0000 (16:06 +0300)
src/plugins/lua/mx_check.lua

index e92a5e7fa06f6aba601657feda675a5797e8f0f0..be13a1322d351233124c9e936706d3f3cce0f3e7 100644 (file)
@@ -68,14 +68,15 @@ 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
-            local end_time = rspamd_util.time_to_string(rspamd_util.get_time() + 3600)
-            task:get_mempool():set_variable("grey_greylisted", end_time)
+            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