Hi Matt -
interesting idea ... but I wonder if this is conforming to the XMPP specifications, particularly related to federated (S2S) message routing. Also, might this introduce a vulnerability for spoofing other domains? I am not opposed to the patch, but I would like a few others to comment/respond before we would merge this type of routing change into the core product.
If it passes muster after further community consideration, one additional request I would have is to put this capability behind a configuration property that would require an admin user to explicitly enable it for a particular installation (off by default). This would further protect against inadvertent (or ill-intentioned) plugins that intercept stanzas destined for other domains.
Anyone one else care to weigh in on this proposal?