public static boolean canAccess(String domain) {
        // If s2s is disabled then it is not possible to send packets to remote servers or
        // receive packets from remote servers
        if (!JiveGlobals.getBooleanProperty(ConnectionSettings.Server.SOCKET_ACTIVE, true)
            && !JiveGlobals.getBooleanProperty(ConnectionSettings.Server.ENABLE_OLD_SSLPORT, true)) {
            return false;
        }

        // By default there is no permission defined for the XMPP entity
        Permission permission = null;

        RemoteServerConfiguration config = getConfiguration(domain);
        if (config == null && RECURSE.getValue()) {
            final int dot = domain.indexOf('.');
            if (dot > -1) {
                return canAccess(domain.substring(dot+1));
            }
        }

        if (config != null) {
            permission = config.getPermission();
        }

        if (PermissionPolicy.blacklist == getPermissionPolicy()) {
            // Anyone can access except those entities listed in the blacklist
            return Permission.blocked != permission;
        }
        else {
            // Access is limited to those present in the whitelist
            return Permission.allowed == permission;
        }
    }
Returns true if the remote server with the specified domain can connect to the
local server.

@param domain the domain of the remote server.
@return true if the remote server with the specified domain can connect to the
        local server.
xmppserver/src/main/java/org/jivesoftware/openfire/server/RemoteServerManager.java