Is it possible to disable a vhost from letting its web apps send emails? Centminmod.
Interesting question as never looked at it from Postfix MTA mail server side. Usually your web app should support disabling email sending on the web app side. What what app is this for ? Wordpress can do it via plugins Disable Emails. vBulletin and Xenforo has it's own config.php options.
I know you can already do it from the web app, but I was curious if it can be done from the vhost. In a situation where your host is strict with emails and you're hosting a friend's site.
Highly recommend you don't If your friend's site is PHP based you could create a separate PHP-FPM pool and in that pool at mail() function as a disabled function PHP: Description of core php.ini directives - Manual and then set specific Nginx vhost to use that PHP-FPM instead of default one in php.conf include file. Code (Text): php_admin_value[disable_functions] = shell_exec,mail But then if your friend's site relies on sending emails, this will break it so probably best he be hosted on a separate server anyway Or other option is to modify your friend's apps to use a 3rd party SMTP server for sending emails so doesn't use your server's Postfix MTA mail server.
By "break", do you mean it'll take the whole site down like a 500 server error, or emails would just fail? The plan is to force their site to use SMTP by providing a login. If the script tries to send emails through postfix, just fail.
break = mail fails to send. But if it's a friend, then just ask him to use SMTP instead PHP mail - shouldn't that hard to do if it's a friend
Great! It's not hard and I am going to tell them to use SMTP. Not disabling it involves trust that they'd keep their promise when I prefer certainty.