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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Email Filter To Reject Mail If Sent To Multiple Recipients

Discussion in 'E-mail Discussions' started by MoreBeer, Aug 13, 2017.

  1. MoreBeer

    MoreBeer Member

    Joined:
    Aug 13, 2017
    Messages:
    6
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    New Jersey
    cPanel Access Level:
    Root Administrator
    I need to create an email filter to reject email if the message was sent to multiple recipients. So, if the message has 7 people within the To Field, it would be rejected. Ideally I'd like the filter to reject the incoming mail if the To Field contains more than 3 recipients.

    Have been trying all kinds of things with no success. I would assume there's some sort of regex code for this, but can only find regex for email validation.

    Need this to help eliminate spam. Any help is immensely appreciated!

    Thanks.
     
  2. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,457
    Likes Received:
    57
    Trophy Points:
    28
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hi,

    You can configure it directly in the exim through a setting called recipients_max. Check the below link:
    14. Main configuration

    Open the Exim Configuration Editor and switch to Advanced Mode. In the very first edit box, enter the following lines and click Save:
    recipients_max = 10
    recipients_max_reject = true
     
  3. MoreBeer

    MoreBeer Member

    Joined:
    Aug 13, 2017
    Messages:
    6
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    New Jersey
    cPanel Access Level:
    Root Administrator
    Thank you so much for this! I've been getting 100+ spam emails per day that get around all the spam filters. Each poses to be an individual email sent to 6 or 7 people and the IP's are all clean. This edit will finally stop it. Thank you again for the information, much appreciated.
     
  4. MoreBeer

    MoreBeer Member

    Joined:
    Aug 13, 2017
    Messages:
    6
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    New Jersey
    cPanel Access Level:
    Root Administrator
    Update: I set the parameters as specified, saved and exim was restarted. I then sent an email to my primary account and included 5 other recipients. The mail was still received?

    - Removed -
     
    #4 MoreBeer, Aug 14, 2017
    Last edited by a moderator: Aug 14, 2017
  5. MoreBeer

    MoreBeer Member

    Joined:
    Aug 13, 2017
    Messages:
    6
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    New Jersey
    cPanel Access Level:
    Root Administrator
    Was unaware of the image linking rules. Anyhow, here's a screenshot of the saved settings which are not stopping mail addressed to more than 3 recipients. Thanks!

    exim-edit.png
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,220
    Likes Received:
    1,376
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Those settings are for messages sent through SMTP on the cPanel server. Are you sending the test email from an email account hosted on the cPanel server, and are the multiple recipients external email addresses?

    Thank you.
     
  7. MoreBeer

    MoreBeer Member

    Joined:
    Aug 13, 2017
    Messages:
    6
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    New Jersey
    cPanel Access Level:
    Root Administrator
    I was sending the test mail from a Gmail account using their web client. I sent the test to my primary email address, the one which is receiving the spam in addition including 5 other test email accounts as recipients. These test accounts I have elsewhere (not on my server) such as Yahoo, AOL, Gmail, etc. I use for testing. I have since enabled Spamassassin with a setting of 10 for this particular domain, which seems to have stopped them, although not 100% sure yet as I get most through the night. Although I'd rather not have Spamassassin enabled due to possibly missing real questions and software unlock requests from customers.
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,220
    Likes Received:
    1,376
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    The recipients_max value in Exim is only application to outgoing messages sent via SMTP from the cPanel server. As far as blocking incoming SPAM emails, have you considered enabling Greylisting? It's documented at:

    Greylisting - Documentation - cPanel Documentation

    Thank you.
     
  9. MoreBeer

    MoreBeer Member

    Joined:
    Aug 13, 2017
    Messages:
    6
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    New Jersey
    cPanel Access Level:
    Root Administrator
    Thanks, I'll look into that. The way it originally sounded to me was that the exim limitation rule would reject incoming mail sent to a defined number of recipients. That might be a good feature to look into implementing as spammers are getting around just about every defense method.
     
    cPanelMichael likes this.
Loading...

Share This Page