Configuring php mail() per domain
I've many VirtualHosts on my Apache webserver with some different CMS (different services, different domain names, different administrators).
I would restrict php mail() function on every VirtualHost to send emails only from apriopriate/given email address (ie. VirtualHost example.com from email@example.com, foobar.com from firstname.lastname@example.org etc.). So when somebody uses mail() function, email should be automatically sent from given (by me) email address.
Emails should be sent via sendmail which is configured to handle emails from multiple domain names (not SMTP).
Is that possible? How?