# HG changeset patch
# User Paul Aurich <paul@darkrain42.org>
# Date 1268864954 25200
# Node ID da70c26fe61bd9d25a8f92b4534e05b9787456f6
# Parent  ffd8091698ee32b4f364b9c42deb78764d5b8055
mod_saslauth: Add a sasl_realm option

diff -r ffd8091698ee -r da70c26fe61b plugins/mod_saslauth.lua
--- a/plugins/mod_saslauth.lua	Mon Mar 15 23:02:16 2010 -0700
+++ 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