how to control messages sent to prevent spamming

Only today one member sent more than 800 messages, I got one of the messages and I knew it was a scam.

How do I control messages being sent on my site?

A-How do I make users  to only send messages to one he or she is friend with?

B-How do I limit the no of messages sent by a user?