I host several live sites, and several staging sites on one server that's running Ubuntu 14.04. Most of the sites are wordpress sites, and are using the php mail() function or the PHPMailer class to send their mail.
What I'd like to do is to prevent certain sites being staged from sending email. Maybe even whitelist the few live domains so that they are the only ones allowed to generate emails.
Is there a quick way to lock down the domains allowed to send mail?