@Override
    protected Document getStreamHeader() {
        final Element stream = DocumentHelper.createElement(QName.get("stream", "stream", "http://etherx.jabber.org/streams"));
        final Document document = DocumentHelper.createDocument(stream);
        document.setXMLEncoding(StandardCharsets.UTF_8.toString());
        stream.add(getNamespace());
        if (ServerDialback.isEnabled() && this.session != null) {
            stream.add(Namespace.get("db", "jabber:server:dialback"));
        }
        stream.addAttribute("from", domainPair.getLocal());
        stream.addAttribute("to", domainPair.getRemote());
        stream.addAttribute("id", session.getStreamID().getID());
        stream.addAttribute(QName.get("lang", Namespace.XML_NAMESPACE), session.getLanguage().toLanguageTag());
        stream.addAttribute("version", Session.MAJOR_VERSION + "." + Session.MINOR_VERSION);
        return document;
    }
Controls if JIDs that are in the addresses of stanzas supplied by remote domains are validated.
xmppserver/src/main/java/org/jivesoftware/openfire/net/ServerStanzaHandler.java