Best practice to implement message gateway

Hi,

I am new to smack. I am trying to develop a server-side message gateway, which allows user to submit data through their IM (gtalk, msn, etc) to my server. Got the basic stuff up running, which is pretty cool.

Couple of questions:

  1. how to fight with spams?

Is there a way to only allow good users (my message gateway’'s friend) to send me messages.

Not sure how exactly gtalk works. Can user submit me message without being my friend?

Assume not.

The the question is how to authenticate user and automatically add user as friend. Currently, I am using setDefaultSubscriptionMode(Roster.SUBSCRIPTION_ACCEPT_ALL), don’'t think it is a good practice.

  1. how about other IMs?

gtalk is easy. how about msn, ym, etc. someone mentioned about openfire and gateway, etc. More details, please.

thanks!