+ local to = stanza.attr.to;
+ if to and not bare_sessions[to] then -- quick check for account existance
+ local node, host = jid_split(to);
+ if not user_exists(node, host) then -- full check for account existance
+ if stanza.attr.type == "get" or stanza.attr.type == "set" then
+ origin.send(st.error_reply(stanza, "cancel", "service-unavailable"));
+ end
+ return true;
+ end
+ end