105 if not session.username then |
105 if not session.username then |
106 features:tag("mechanisms", mechanisms_attr); |
106 features:tag("mechanisms", mechanisms_attr); |
107 -- TODO: Provide PLAIN only if TLS is active, this is a SHOULD from the introduction of RFC 4616. This behavior could be overridden via configuration but will issuing a warning or so. |
107 -- TODO: Provide PLAIN only if TLS is active, this is a SHOULD from the introduction of RFC 4616. This behavior could be overridden via configuration but will issuing a warning or so. |
108 features:tag("mechanism"):text("PLAIN"):up(); |
108 features:tag("mechanism"):text("PLAIN"):up(); |
109 features:tag("mechanism"):text("DIGEST-MD5"):up(); |
109 features:tag("mechanism"):text("DIGEST-MD5"):up(); |
110 if config.get(session.host or "*", "core", "sasl_anonymous") then |
110 if config.get(session.host or "*", "core", "anonymous_login") then |
111 features:tag("mechanism"):text("ANONYMOUS"):up(); |
111 features:tag("mechanism"):text("ANONYMOUS"):up(); |
112 end |
112 end |
113 features:up(); |
113 features:up(); |
114 else |
114 else |
115 features:tag("bind", bind_attr):tag("required"):up():up(); |
115 features:tag("bind", bind_attr):tag("required"):up():up(); |