You can enable a list of domains for server-to-server chat communication, called federation.
Messages service also federates, or unites with, other Messages services or any XMPP-compliant service (such as Google Talk, Facebook Chat, Wildfire, and Jabber) using the server-to-server (S2S) capabilities of XMPP. This allows users with accounts on Messages services to exchange text messages or files with users whose accounts are maintained outside their local network infrastructure, as long as those Messages services are accessible over the Internet.
Only host names and domains that are listed can communicate with your server. This is called a federation domain list.
The federation domain list entries can be complete host names or domains. (This can be a mix of servers and domains.)
The server software does the rule-matching to see if these domains can interact. Any domain or host not in the approved list cannot communicate with your Messages server.