# HG changeset patch # User Matthew Wild # Date 1701776351 0 # Node ID 33e5edbd6a4a5a0025a17f839f7c49efce8c2f1c # Parent 72d7830505f06bd051008869b29711c90e54bb41 mod_saslauth: Fire event per SASL step This matches the behaviour of the newer mod_sasl2 implementation. It allows plugins to observe (and potentially, with caution, modify) the SASL exchange. diff -r 72d7830505f0 -r 33e5edbd6a4a plugins/mod_saslauth.lua --- a/plugins/mod_saslauth.lua Sat Dec 02 21:45:38 2023 +0100 +++ b/plugins/mod_saslauth.lua Tue Dec 05 11:39:11 2023 +0000 @@ -87,9 +87,12 @@ return true; end end - local status, ret, err_msg = session.sasl_handler:process(text); + local sasl_handler = session.sasl_handler; + local status, ret, err_msg = sasl_handler:process(text); status, ret, err_msg = handle_status(session, status, ret, err_msg); - local s = build_reply(status, ret, err_msg); + local event = { session = session, message = ret, error_text = err_msg }; + module:fire_event("sasl/"..session.base_type.."/"..status, event); + local s = build_reply(status, event.message, event.error_text); session.send(s); return true; end