commit 3638ca6: [Fix] External_relay: Restore the originating hostname check

Vsevolod Stakhov vsevolod at rspamd.com
Thu Sep 22 19:56:03 UTC 2022


Author: Vsevolod Stakhov
Date: 2022-09-22 20:53:30 +0100
URL: https://github.com/rspamd/rspamd/commit/3638ca67bdeb181c9ed7b4598933c2655846c280 (HEAD -> master)

[Fix] External_relay: Restore the originating hostname check
Issue: #4272

---
 src/plugins/lua/external_relay.lua | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/plugins/lua/external_relay.lua b/src/plugins/lua/external_relay.lua
index 841eca32f..9f65490e9 100644
--- a/src/plugins/lua/external_relay.lua
+++ b/src/plugins/lua/external_relay.lua
@@ -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


More information about the Commits mailing list