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.

Account Level Filter for IP Range

Discussion in 'E-mail Discussions' started by drippin, Apr 29, 2014.

  1. drippin

    drippin Registered

    Joined:
    Apr 29, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    I am using Account Level Filtering to block spam. I recently found that most US spam comes from IP ranges, so I am trying to use "Matches Regex" to block the ranges. My example below is the Regex to block range 198.46.152.0 to 198.46.152.255:

    \b\[198\.46\.152\.(?:12[0-7]|1[01][0-9]|[1-9]?[0-9])\]\b

    Here is my filter.yaml content:

    match: matches
    opt: or
    part: $message_headers
    val: \b\[198\.46\.152\.(?:12[0-7]|1[01][0-9]|[1-9]?[0-9])\]\b

    I've tested the regex and it appears OK.

    My question is : Does the rule look correct?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Have you considered blocking the IP range under "Access Lists" in "WHM Home » Service Configuration » Exim Configuration Manager", or do you only have cPanel access on this server? Here is a regular expression you could try for the IP range you referenced:

    Code:
    ^198\.46\.152\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))$
    Thank you.
     
  3. drippin

    drippin Registered

    Joined:
    Apr 29, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Thank you so much. I do not have access to the server. I will try in Account Level Filter.
     
  4. drippin

    drippin Registered

    Joined:
    Apr 29, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    I dropped the anchors and it is working.
    Thanks again.
     
Loading...

Share This Page