Comparison

plugins/mod_saslauth.lua @ 2894:066c199135d5

mod_saslauth: Add a sasl_realm option
author Paul Aurich <paul@darkrain42.org>
date Wed, 17 Mar 2010 15:29:14 -0700
parent 2724:3fcf1048a896
child 2925:692b3c6c5bd2
comparison
equal deleted inserted replaced
2888:ab6dac843e9c 2894:066c199135d5
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);