]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] External_relay: Restore the originating hostname check
authorVsevolod Stakhov <vsevolod@rspamd.com>
Thu, 22 Sep 2022 19:53:30 +0000 (20:53 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Thu, 22 Sep 2022 19:53:30 +0000 (20:53 +0100)
Issue: #4272

src/plugins/lua/external_relay.lua

index 841eca32fb74c2fa65b91ec4ec56d71e213bd89b..9f65490e95e1f93c2d7ef2fc26135afd4ec4595a 100644 (file)
@@ -159,6 +159,11 @@ strategies.hostname_map = function(rule)
       return
     end
 
+    if not hostname_map:get_key(from_hn) then
+      lua_util.debugm(N, task, 'sender\'s hostname (%s) is not a relay', from_hn)
+      return
+    end
+
     local rcvd_hdrs = task:get_received_headers()
     -- Try find sending hostname in Received headers
     for _, rcvd in ipairs(rcvd_hdrs) do