Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Block all outgoing emails and only allow specific addresses?

Discussion in 'E-mail Discussion' started by dabihsss, Apr 6, 2018.

  1. dabihsss

    dabihsss Member

    Joined:
    Mar 30, 2010
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    51
    How to block all emails sent from PHP scripts and nobody user and set up file which contains allowed from email addresses which I manually specify?

    is there any way to do that like exim_blacklist filter
     
  2. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,888
    Likes Received:
    90
    Trophy Points:
    78
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hi,

    The same kind of discussion can be seen in the below link of the cPanel forum.. Please take a look at it..

    Exim Blacklist Domains Issue
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. dabihsss

    dabihsss Member

    Joined:
    Mar 30, 2010
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    51
    I am looking for a solution to stop outgoing spam from scripts, not the incoming spam.

    check for a list of allowed email ids before sending emails, if not in list discard the message.
     
  4. cPanelLauren

    cPanelLauren Forums Analyst II
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    3,838
    Likes Received:
    275
    Trophy Points:
    193
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    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:

    Code:
    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:

    Blocking all cPanel users from emailing specific domains/email accounts

    Thank you,
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. dabihsss

    dabihsss Member

    Joined:
    Mar 30, 2010
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    51

    I am looking for a solution like the following

    "Sending emails from PHP/Application is disabled globally and there will be a plugin button in cpanel, through that cpanel users can specify/whitelist single or multiple email address that can send mail from script"

    I have seen the above feature with resellerclub's cpanel servers (i am trying to build a plugin like that).
     
  6. cPanelLauren

    cPanelLauren Forums Analyst II
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    3,838
    Likes Received:
    275
    Trophy Points:
    193
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    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:

    Guide to cPanel Plugins - Developer Documentation - cPanel Documentation

    Guide to cPanel Plugins - Add Plugins to Version 11.44 and Later - Developer Documentation - cPanel Documentation

    How to create a Plugin (WHM & cPanel)

    For the actual blocking of outbound mail there's also:

    Exim Filter To block Outgoing Email

    How to Customize the Exim System Filter File - cPanel Knowledge Base - cPanel Documentation


    Thank you,
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice