Openfire bouncing message back to sender

I am making a Openfire plugin for send the message from server to client.

A client send a message with a custom extension without to attribute because the plugin will decide reciepants.But the Openfire is bouncing it back to sender.How to make this approach work