comparison plugins/mod_saslauth.lua @ 2898:da70c26fe61b

mod_saslauth: Add a sasl_realm option
author Paul Aurich <paul@darkrain42.org>
date Wed, 17 Mar 2010 15:29:14 -0700
parents 3fcf1048a896
children 692b3c6c5bd2
comparison
equal deleted inserted replaced
2897:ffd8091698ee 2898:da70c26fe61b
159 local origin, features = event.origin, event.features; 159 local origin, features = event.origin, event.features;
160 if not origin.username then 160 if not origin.username then
161 if secure_auth_only and not origin.secure then 161 if secure_auth_only and not origin.secure then
162 return; 162 return;
163 end 163 end
164 local realm = module:get_option("sasl_realm") or origin.host;
164 if module:get_option("anonymous_login") then 165 if module:get_option("anonymous_login") then
165 origin.sasl_handler = new_sasl(origin.host, anonymous_authentication_profile); 166 origin.sasl_handler = new_sasl(realm, anonymous_authentication_profile);
166 else 167 else
167 origin.sasl_handler = new_sasl(origin.host, default_authentication_profile); 168 origin.sasl_handler = new_sasl(realm, default_authentication_profile);
168 if not (module:get_option("allow_unencrypted_plain_auth")) and not origin.secure then 169 if not (module:get_option("allow_unencrypted_plain_auth")) and not origin.secure then
169 origin.sasl_handler:forbidden({"PLAIN"}); 170 origin.sasl_handler:forbidden({"PLAIN"});
170 end 171 end
171 end 172 end
172 features:tag("mechanisms", mechanisms_attr); 173 features:tag("mechanisms", mechanisms_attr);