After upgrading to 3.9.1 from 3.6.x, server-to-server was broken for our site that uses the parent domain of all our other domains. The HQ is domain.com, the other sites are a.domain.com, b.domain.com, etc. Server to server works fine between child domains, and I could see that when a child domain wanted to contact the parent domain, a one-way server connection showed up in the active sessions. But the parent domain could not route packets to the child domains.
Searching the forums shows a reference to a previous bug (JM-1203) that was fixed. People wondered if this was a regression, but there was no developer feedback. There are several other related posts about the same issue still being present in (or returning to) the code.
I reviewed the code for org.jivesoftware.openfire.spi.RoutingTableImpl and the problem seems fairly obvious to me. If the destination JID contains the local server name (xmpp.domain) then the packet is sent to the routeToComponent() method. The if/else logic used makes it impossible for a JID containing a child domain of the local server to be sent to the routeToRemoteDomain() method.
I modified a local copy of the code and inserted the resulting class files into my openfire.jar file and it seems to get the job done. I am not prepared to say that I have not introduced any other problems because I have no other experience coding for openfire. I have attached my patch, but with me being an openfire noob, proceed with caution.
I took a look at the current version of the file on the SVN trunk and the flawed code is still there.