# HG changeset patch # User Matthew Wild # Date 1735419728 0 # Node ID bd3ff802d8836acd98c3582f3b2e32f7f6ec1484 # Parent 6dca425eea150d050e62c36810a22a350f56a289 mod_anti_spam: Fix another traceback for origin sessions without an IP This is likely to be the case for stanzas originating from local hosts, for example (so not true s2s). It should be safe to bypass the IP check for those. diff -r 6dca425eea15 -r bd3ff802d883 mod_anti_spam/mod_anti_spam.lua --- a/mod_anti_spam/mod_anti_spam.lua Sat Dec 28 18:45:40 2024 +0000 +++ b/mod_anti_spam/mod_anti_spam.lua Sat Dec 28 21:02:08 2024 +0000 @@ -65,9 +65,9 @@ end local raw_ip = session.ip; local parsed_ip = raw_ip and ip.new_ip(session.ip); - if not parsed_ip then - session.log("warn", "mod_anti_spam: Unable to determine IP address (missing/invalid)"); - elseif spam_source_ips:contains_ip(parsed_ip) then + -- Not every session has an ip - for example, stanzas sent from a + -- local host session + if parsed_ip and spam_source_ips:contains_ip(parsed_ip) then return true; end end