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 spam email addresses in WHM?

Discussion in 'E-mail Discussion' started by CharlesGLondon, Mar 22, 2019.

  1. CharlesGLondon

    CharlesGLondon Member

    Joined:
    Jan 30, 2019
    Messages:
    5
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    London
    cPanel Access Level:
    Website Owner
    I'm sure this question has been asked before and I've seen some answers but that's too complicated.

    How to I block spam email addresses at WHM level (not cPanel) so that it is blocked for all accounts on this WHM? Is there any easy way to do it.

    P.S. I don't want to block by IP addresses but by email addresses.

    I've already configured block by domain at WHM but it's not helping as spammers are using gmail, hotmail etc accounts and I don't want to block these big guns by domain name.
     
  2. keat63

    keat63 Well-Known Member

    Joined:
    Nov 20, 2014
    Messages:
    1,265
    Likes Received:
    86
    Trophy Points:
    28
    cPanel Access Level:
    Root Administrator
    CSF Mailscanner will do this with ease, but it's not free unfortunately.
    There is a tweak you could add to your exim config, but this would rely on you manually updating a list on the server.
    Unlike CSF mailscanner which is GUI driven.

    Search the forum for exim blacklist, it crops up quite frequently.

    A global filter at WHM level would be a nice feature, maybe i'll raise it as a feature request.
     
  3. CharlesGLondon

    CharlesGLondon Member

    Joined:
    Jan 30, 2019
    Messages:
    5
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    London
    cPanel Access Level:
    Website Owner
    Tx for replying. When you manage multiple servers with over hundreds of domains on each of them then it becomes obvious that we need something to handle spam emails at WHM level. It's just frustrating to keep deleting thousands of spams which we keep deleting everyday and no matter what we do they don't stop coming. Thanks to millions of new tld domains it's not impossible to do even domain blocking.
     
  4. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    6,161
    Likes Received:
    474
    Trophy Points:
    233
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. keat63

    keat63 Well-Known Member

    Joined:
    Nov 20, 2014
    Messages:
    1,265
    Likes Received:
    86
    Trophy Points:
    28
    cPanel Access Level:
    Root Administrator
    There is a free RBL list called SpamEatingMonkey, which has a few blocklists based on the age of the domain.
    along the lines of domains created in the last 5, 10, 15 & 30 days.
    And then theres spamcop, and barracuda that you could employ.
    None guaranteed to kill all spam, but all work well together in defeating some of it.
     

    Attached Files:

    Jean Boudreau likes this.
  6. Jean Boudreau

    Jean Boudreau Member

    Joined:
    Mar 31, 2017
    Messages:
    19
    Likes Received:
    5
    Trophy Points:
    3
    Location:
    Caraquet, NB, Canada
    cPanel Access Level:
    Root Administrator
    Thank you very much for sharing the Custom RBL's!! It will surely help me as I was just using the default one. I have some issues with spam so it will surely help our servers.

    I now just need to find a way to scan message when a webform is used on a website. It's just doesn't scan them and deliver it to local account.
     
  7. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    6,161
    Likes Received:
    474
    Trophy Points:
    233
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Can you elaborate on what you mean by scan?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. LeeL

    LeeL Registered

    Joined:
    Dec 21, 2017
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Edinburgh, UK.
    cPanel Access Level:
    Root Administrator
    I think what he means Lauren is the same issue as we have when users use our "contact us" page from within our webpage to spam us.

    So we have hello@mydomain.com as a way for people to reach us, spambots constantly send us spam from this page and is there a way to limit it? We get around 120 emails per day. purely spam from this, and since its a local delivery, it isn't filtered through RBLs.
     
  9. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    6,161
    Likes Received:
    474
    Trophy Points:
    233
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @LeeL

    In your case it might be best to employ some form of captcha, this would be the most effective method of preventing this. As far as once the mail is submitted there really isn't a way to do what you're requesting with PHP mail since it's considered a local delivery.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    LeeL likes this.
  10. keat63

    keat63 Well-Known Member

    Joined:
    Nov 20, 2014
    Messages:
    1,265
    Likes Received:
    86
    Trophy Points:
    28
    cPanel Access Level:
    Root Administrator
    Googles ReCaptur will solve a lot of the web form spamming
    The sort of thing you often see.. 'prove you are human' 'tick this box' 'click on pictures of bridges'

    ReCapture may have to be coded in to your web form though.
     
    LeeL and cPanelLauren like this.
  11. keat63

    keat63 Well-Known Member

    Joined:
    Nov 20, 2014
    Messages:
    1,265
    Likes Received:
    86
    Trophy Points:
    28
    cPanel Access Level:
    Root Administrator
    I wrote something a while ago, based on a PHP contact form.
    It will be very much trial and error to get it to work for you, but your'e welcome to look and see if you can glean anything from it.

    I had 2 url's.
    one which said success, another which said failed.
    My contact form had a jpg image with the letters 'jw62k', this was my crude form of 'prove you are human'
    The human had to type those letters in a box to succeed.
    If this was compromised, i'd change the letters.

    Code:
    <?php
    
    //$EmailFrom = "-f$Email";
    $EmailFrom = "your name";
    $EmailTo = "where you want the email to go";
    $Subject = "your subject";
    $Name = Trim(stripslashes($_POST['Name']));
    $Company = Trim(stripslashes($_POST['Company']));
    $Address1 = Trim(stripslashes($_POST['Address1']));
    $Address2 = Trim(stripslashes($_POST['Address2']));
    $Town = Trim(stripslashes($_POST['Town']));
    $City = Trim(stripslashes($_POST['City']));
    $Postcode = Trim(stripslashes($_POST['Postcode']));
    $Tel = Trim(stripslashes($_POST['Tel']));
    $Email = Trim(stripslashes($_POST['Email']));
    $Message = Trim(stripslashes($_POST['Message']));
    
    // validation
    $validationOK=true;
    if (!$validationOK) {
      print "<meta http-equiv=\"refresh\" content=\"0;URL=http://www.your failed url\">";
      exit;
    }
    
    // prepare email body text
    $Body = "";
    $Body .= "Name: ";
    $Body .= $Name;
    $Body .= "\n";
    $Body .= "Company: ";
    $Body .= $Company;
    $Body .= "\n";
    $Body .= "Address1: ";
    $Body .= $Address1;
    $Body .= "\n";
    $Body .= "Address2: ";
    $Body .= $Address2;
    $Body .= "\n";
    $Body .= "Town: ";
    $Body .= $Town;
    $Body .= "\n";
    $Body .= "City: ";
    $Body .= $City;
    $Body .= "\n";
    $Body .= "Postcode: ";
    $Body .= $Postcode;
    $Body .= "\n";
    $Body .= "\n";
    $Body .= "Tel: ";
    $Body .= $Tel;
    $Body .= "\n";
    $Body .= "Email: ";
    $Body .= $Email;
    $Body .= "\n";
    $Body .= "Message: ";
    $Body .= $Message;
    $Body .= "\n";
    
    
    if (Trim(stripslashes($_POST['answer']))=='jw62k'){
    // send email
    $success = mail($EmailTo, $Subject, $Body, $mailheaders, "-f$Email");
    
    // redirect to success page
    if ($success){
      print "<meta http-equiv=\"refresh\" content=\"0;URL=http://www.your sucess url\">";
    }
    } else{
      print "<meta http-equiv=\"refresh\" content=\"0;URL=http://www.your failed url\">";
    }
    ?>
    
     
    cPanelLauren likes this.
  12. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    6,161
    Likes Received:
    474
    Trophy Points:
    233
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    @keat63

    This is exactly what I was thinking of when I suggested it, thanks!
     
    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