Limit sending email by domain

Limit sending email by domain

does anyone know if the following is possible.

I would like to restrict sending of email (of certain users) to internal mail only. ie. only able to send email to users on the same domain. 

example:
me@mydomain.com can send email to you@mydomain.com fine
but
me@mydomain.com is prohibited from sending mail to you@yourdomain.com or any other domain other than mydomain.com


hope that makes sense?

Andy