mod_saslauth: Fire authentication-success and authentication-failure events (thanks scitor)
--- a/plugins/mod_saslauth.lua Fri Aug 26 16:02:08 2011 +0500
+++ b/plugins/mod_saslauth.lua Mon Aug 29 12:01:42 2011 -0400
@@ -48,8 +48,10 @@
local function handle_status(session, status, ret, err_msg)
if status == "failure" then
+ module:fire_event("authentication-failure", { session = session, condition = ret, text = err_msg });
session.sasl_handler = session.sasl_handler:clean_clone();
elseif status == "success" then
+ module:fire_event("authentication-success", { session = session });
local username = nodeprep(session.sasl_handler.username);
local ok, err = sm_make_authenticated(session, session.sasl_handler.username);