Software /
code /
prosody
Changeset
12526:252ed01896dd 0.12 0.12.1
mod_smacks: Bounce unhandled stanzas from local origin (fix #1759)
Sending stanzas with a remote session as origin when the stanzas have a
local JID in the from attribute trips validation in core.stanza_router,
leading to warnings:
> Received a stanza claiming to be from remote.example, over a stream authed for localhost.example
Using module:send() uses the local host as origin, which is fine here.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 27 May 2022 14:45:35 +0200 |
parents | 12525:8087f5357f53 |
children | 12527:923d6fe5ee41 12543:cf29bdb74c15 |
files | plugins/mod_smacks.lua |
diffstat | 1 files changed, 1 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_smacks.lua Fri May 27 12:05:47 2022 +0200 +++ b/plugins/mod_smacks.lua Fri May 27 14:45:35 2022 +0200 @@ -55,7 +55,6 @@ local it = require"util.iterators"; local sessionmanager = require "core.sessionmanager"; -local core_process_stanza = prosody.core_process_stanza; local xmlns_errors = "urn:ietf:params:xml:ns:xmpp-stanzas"; local xmlns_delay = "urn:xmpp:delay"; @@ -420,7 +419,7 @@ if not module:fire_event("delivery/failure", { session = session, stanza = stanza }) then if stanza.attr.type ~= "error" and stanza.attr.from ~= session.full_jid then local reply = st.error_reply(stanza, "cancel", "recipient-unavailable"); - core_process_stanza(session, reply); + module:send(reply); end end end