If you send a subscription request (such as subscribe) to a member on another server:
<presence to="email@example.com" type="subscribe" from="firstname.lastname@example.org/web"> <priority>0</priority> </presence>
If the other server is not available then OutgoingSessionPromise will send an error back to the sender.
(This is a very important step so the client knows that the subscription failed to send.)
The code that does this is in: OutgoingSessionPromise - returnErrorToSender
resence reply = new Presence();
routingTable.routePacket(reply.getTo(), reply, true);
The code fragment above shows that the error is routed back again.
The problem is the line: reply.setTo(from);
The “from” no longer has the resource in it because it was stripped out earlier in PresenceSubscribeHandler process.
So an error gets generated in the routePacket function. A presence can’t be routed to a bare JID and an error is generated in the WARN log:
org.jivesoftware.openfire.PacketException: Cannot route packet of type IQ or Presence to bare JID: <presence to="email@example.com" from="firstname.lastname@example.org" type="error"> <error code="404" type="cancel"> <remote-server-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/> </error> </presence>
We really need that error sent back to the client.
Could this please be corrected in the next release.
openfire.xml (1346 Bytes)