Skip to main content

Block all outgoing emails and only allow specific addresses?

Comments

5 comments

  • 24x7server
    Hi, The same kind of discussion can be seen in the below link of the cPanel forum.. Please take a look at it..
    0
  • dabihsss
    Hi, The same kind of discussion can be seen in the below link of the cPanel forum.. Please take a look at it..
    0
  • cPanelLauren
    Hi @dabihsss To clarify you want to do the following: Block all PHP mail and block nobody from sending mail for all accounts except those you specify? - Because php mail is allowed through the php.ini for that specific php version you'd need to disallow mail and sendmail in disable_functions: disable_functions = "mail,sendmail"
    The problem with this would be that it's global and would affect all users unless you added a php.ini file for each user disabling this except for the ones you'd like to allow -For disallowing the nobody user from sending mail you can go to WHM>>Server Configuration>>Tweak Settings and enable the following setting: Prevent "nobody" from sending mail Prevent the user "nobody" from sending out mail to remote addresses This would be a global modification as well -The following post discusses how to block specific domains from sending mail all together which might be useful to you as well: Thank you,
    0
  • dabihsss
    Hi @dabihsss To clarify you want to do the following: Block all PHP mail and block nobody from sending mail for all accounts except those you specify? - Because php mail is allowed through the php.ini for that specific php version you'd need to disallow mail and sendmail in disable_functions: disable_functions = "mail,sendmail"
    The problem with this would be that it's global and would affect all users unless you added a php.ini file for each user disabling this except for the ones you'd like to allow -For disallowing the nobody user from sending mail you can go to WHM>>Server Configuration>>Tweak Settings and enable the following setting: Prevent "nobody" from sending mail Prevent the user "nobody" from sending out mail to remote addresses This would be a global modification as well -The following post discusses how to block specific domains from sending mail all together which might be useful to you as well:
    0
  • cPanelLauren
    Hello, While the link I provided may still be useful in terms of the how they get blocked. If you're attempting to build a plugin you might want to look at the following:
    0

Please sign in to leave a comment.