Changeset

2894:066c199135d5

mod_saslauth: Add a sasl_realm option
author Paul Aurich <paul@darkrain42.org>
date Wed, 17 Mar 2010 15:29:14 -0700
parents 2888:ab6dac843e9c
children 2895:ea5fe15a82f5
files plugins/mod_saslauth.lua
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_saslauth.lua	Wed Mar 17 14:36:23 2010 +0000
+++ b/plugins/mod_saslauth.lua	Wed Mar 17 15:29:14 2010 -0700
@@ -161,10 +161,11 @@
 		if secure_auth_only and not origin.secure then
 			return;
 		end
+		local realm = module:get_option("sasl_realm") or origin.host;
 		if module:get_option("anonymous_login") then
-			origin.sasl_handler = new_sasl(origin.host, anonymous_authentication_profile);
+			origin.sasl_handler = new_sasl(realm, anonymous_authentication_profile);
 		else
-			origin.sasl_handler = new_sasl(origin.host, default_authentication_profile);
+			origin.sasl_handler = new_sasl(realm, default_authentication_profile);
 			if not (module:get_option("allow_unencrypted_plain_auth")) and not origin.secure then
 				origin.sasl_handler:forbidden({"PLAIN"});
 			end