Server to server messages from our intranet to our openfire users

I would like to use xmpp as a notification method for an intranet I am building.

This is not wholly related to Openfire, its more about the XMPP protocol’s server federation.

Is there a simple way I can send messages from my intranet site to users on my openfire server via server to server federation? XMPPHP partly can allow me to do this, but it acts as a client and logs into a jabber server as a user to send messages. I would simply like have the intranet site send messages to openfire as if it were another jabber server.

For example, if I want to notify a user when new content is added to the intranet:

  1. jabber.mydomain.com (openfire) has been set up to accept server to server communication from intranet.mydomain.com.
  2. intranet.mydomain.com is set to send a message to joe@jabber.mydomain.com when new files are uploaded.
  3. When a file is added, intranet.mydomain.com sends a message from noreply@intranet.mydomain.com to joe@japper.mydomain.com via XMPP server to server communication.
  4. jabber.mydomain.com (openfire) accepts the message for the user and send it to the user joe@jabber.mydomain.com.

I do not care about two way communication, hence the ficticious “noreply@intranet.mydomain.com” ID. I just want to send messages to my jabber users.

So I think I will just set up a very basic ejabberd server on intranet.mydomain.com with one user for the intranet website to send messages with by using XMPPHP. It seems to work in practice with GUI clients, although I haven’t used XMPPHP.

Here are the steps I took:

  • installed ejabberd from debian repos
  • uncommented “{route_subdomains, s2s}.” in the config
  • registered user website using ejabberdctl*
    *
  • whitelist intranet.mydomain.com in jabber.mydomain.com openfire “server to server” config
  • connected with pidgin as user* website* to intranet.mydomain.com
  • sent messages to users @jabber.mydomain.com

My reason for not simply adding a user to openfire for the intranet website to login as is that I do not have privledges on the LDAP server we are using to auth openfire against.