PacketInterceptor: How to forge "from" Message?

Hi,

I would like to initiate chat message between 2 users. (my scenario: userA click on a website to contact userB).

So my server have:

  • to send a message from A to B

  • to send a message from B to A

I developped a PacketInterceptor doing the following things

Message packet = new Message();

packet.setType(msg.getType());

packet.setThread(msg.getThread());

packet.setFrom(vFrom);

packet.setTo(vTo);

packet.setBody(message.getBody());

XMPPServer.getInstance().getPacketRouter().route(packet);

=> It works if the “from” forged address is in server domain a@domain.com

=> if B is a GTalk Address B must have a@domain.com in it’s roster

=> It do not work if the 2 addresses are unknown

My questions:

  • is there OpenFire restriction on “from” address

  • is there a way to override them

  • may be i’m doing something wrong, and may be there is a better way to kickstart an IM conversation between 2 users ?

Best Regards,

JP

May be XEP-033 is an other answer ?

http://xmpp.org/extensions/xep-0033.html