Automatic role assignment based on email domain?

Is there a way to automatically assign roles to users based on their email domain?   I'd like to automatically add employees to the employee role based on the company email domain.