I have a local development server (centos) which I develop a number of websites on. Occasionally I need to test email sending scripts.
I want to avoid the development server from sending emails to anyone who doesn't have an email address with a particular domain (ie: jon@mydomain.com, mary@mydomain.com, etc). So, I would like to create a white list or rule on the server which prevents emails being sent to any email address that doesn't match mydomain.com.
I'm currently using PHP's built-in mail() function. But I imagine this is something more on the server level and I would like something that will manage ANY emails sent out from the server from any program/app/script/etc.
I can confirm that PHP is using /usr/sbin/sendmail.sendmail