Comparison

mod_anti_spam/mod_anti_spam.lua @ 6158:73c523248558

mod_anti_spam: Fix generation of error bounce stanzas
author Matthew Wild <mwild1@gmail.com>
date Fri, 17 Jan 2025 12:19:55 +0000 (2 months ago)
parent 6157:ddb0fac151ac
child 6191:94399ad6b5ab
comparison
equal deleted inserted replaced
6157:ddb0fac151ac 6158:73c523248558
48 48
49 count_spam_blocked:with_labels(reason):add(1); 49 count_spam_blocked:with_labels(reason):add(1);
50 50
51 if action == "bounce" then 51 if action == "bounce" then
52 module:log("debug", "Bouncing likely spam %s from %s (%s)", event.stanza.name, event.stanza.attr.from, reason); 52 module:log("debug", "Bouncing likely spam %s from %s (%s)", event.stanza.name, event.stanza.attr.from, reason);
53 event.origin.send(st.error_reply("cancel", "policy-violation", reason_messages[reason] or reason_messages.default)); 53 event.origin.send(st.error_reply(event.stanza, "cancel", "policy-violation", reason_messages[reason] or reason_messages.default));
54 else 54 else
55 module:log("debug", "Discarding likely spam %s from %s (%s)", event.stanza.name, event.stanza.attr.from, reason); 55 module:log("debug", "Discarding likely spam %s from %s (%s)", event.stanza.name, event.stanza.attr.from, reason);
56 end 56 end
57 57
58 return true; 58 return true;