Changeset

6127:559648c7c8d6

mod_anti_spam: Skip content filtering for messages with no body (thanks Martin)
author Matthew Wild <mwild1@gmail.com>
date Tue, 31 Dec 2024 15:17:37 +0000
parents 6126:4b1a4be43487
children 6128:8ef4d825ad50
files mod_anti_spam/mod_anti_spam.lua
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_anti_spam/mod_anti_spam.lua	Mon Dec 30 13:54:30 2024 +0000
+++ b/mod_anti_spam/mod_anti_spam.lua	Tue Dec 31 15:17:37 2024 +0000
@@ -92,6 +92,8 @@
 	if not (spammy_strings or spammy_patterns) then return; end
 
 	local body = stanza:get_child_text("body");
+	if not body then return; end
+
 	if spammy_strings then
 		for _, s in ipairs(spammy_strings) do
 			if body:find(s, 1, true) then