# HG changeset patch # User Matthew Wild # Date 1735566758 0 # Node ID bdbf12a2a854f076a5578349084da3e038639eda # Parent f6bbf42c341cb06e0ad94907c6eafd9c3d8f9bc3 mod_anti_spam: Add some debug logs This can be useful to diagnose issues when spam slips through. diff -r f6bbf42c341c -r bdbf12a2a854 mod_anti_spam/mod_anti_spam.lua --- a/mod_anti_spam/mod_anti_spam.lua Mon Dec 30 13:51:35 2024 +0000 +++ b/mod_anti_spam/mod_anti_spam.lua Mon Dec 30 13:52:38 2024 +0000 @@ -145,6 +145,8 @@ local from_bare = jid_bare(event.stanza.attr.from); if not is_from_stranger(from_bare, event) then return; end + module:log("debug", "Processing message from stranger..."); + if is_spammy_server(event.origin) then return block_spam(event, "known-spam-source", "drop"); end @@ -156,6 +158,8 @@ if is_spammy_content(event.stanza) then return block_spam(event, "spam-content", "drop"); end + + module:log("debug", "Allowing message through"); end, 500); module:hook("presence/bare", function (event) @@ -163,11 +167,19 @@ return; end + module:log("debug", "Processing subscription request..."); + if is_spammy_server(event.origin) then return block_spam(event, "known-spam-source", "drop"); end + module:log("debug", "Not from known spam source server"); + if is_spammy_sender(event.stanza) then return block_spam(event, "known-spam-jid", "drop"); end + + module:log("debug", "Not from known spam source JID"); + + module:log("debug", "Allowing subscription request through"); end, 500);