How to close opportunity for sending mail by php scripts for some users

Hello!
There is need to turn off sending emails via php functions for some users | domains
Is there an configuration for it, above php.ini for current user
If virus crack site, they can change limits in php.ini
Need to write rules globally
Thank you!

I found same way:
go to /etc/php/{PHP_VERSION}/fpm/pool.d/{USER}.conf
added:
/etc/php/{PHP_VERSION}/fpm/pool.d/{USER}.conf

And if somebody get an access to account, and added php.ini, rules below will be stronger