Changeset

4190:6f509033f855

mod_auth_cyrus: Print some diagnostic log messages about the available mechanisms.
author Waqas Hussain <waqas20@gmail.com>
date Wed, 23 Feb 2011 01:22:04 +0500
parents 4189:ab1a0ffbfdf5
children 4191:dfeae208e5b4
files plugins/mod_auth_cyrus.lua
diffstat 1 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_auth_cyrus.lua	Tue Feb 22 18:37:29 2011 +0000
+++ b/plugins/mod_auth_cyrus.lua	Wed Feb 23 01:22:04 2011 +0500
@@ -27,6 +27,19 @@
 	);
 end
 
+do -- diagnostic
+	local realm = module:get_option("sasl_realm") or module.host;
+	local list;
+	for mechanism in pairs(new_sasl(realm):mechanisms()) do
+		list = (not(list) and mechanism) or (list..", "..mechanism);
+	end
+	if not list then
+		module:log("error", "No Cyrus SASL mechanisms available");
+	else
+		module:log("debug", "Available Cyrus SASL mechanisms: %s", list);
+	end
+end
+
 function new_default_provider(host)
 	local provider = { name = "cyrus" };
 	log("debug", "initializing default authentication provider for host '%s'", host);