commit 86904bf: [Minor] Mx check: Add wait_for_greeting option

Vsevolod Stakhov vsevolod at highsecure.ru
Sun Nov 21 16:42:06 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-11-21 16:36:26 +0000
URL: https://github.com/rspamd/rspamd/commit/86904bf22bbceb18718db0d3e7f11592d8a120ba (HEAD -> master)

[Minor] Mx check: Add wait_for_greeting option
Issue: #3966

---
 src/plugins/lua/mx_check.lua | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/plugins/lua/mx_check.lua b/src/plugins/lua/mx_check.lua
index 678c21566..a7ea7aee7 100644
--- a/src/plugins/lua/mx_check.lua
+++ b/src/plugins/lua/mx_check.lua
@@ -38,6 +38,7 @@ local settings = {
   greylist_invalid = true, -- Greylist first message with invalid MX (require greylist plugin)
   key_prefix = 'rmx',
   max_mx_a_records = 5, -- Maximum number of A records to check per MX request
+  wait_for_greeting = false, -- Wait for SMTP greeting and emit `quit` command
 }
 local redis_params
 local exclude_domains
@@ -155,6 +156,12 @@ local function mx_check(task)
           valid = true
           mxes[name].working = true
         end
+
+        -- Disconnect without SMTP dialog
+        if not settings.wait_for_greeting then
+          check_results(mxes)
+          conn:close()
+        end
       end
 
       if err or not results or #results == 0 then


More information about the Commits mailing list