Account Level Filter for IP Range
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?
-
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: ^198\.46\.152\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))$
Thank you.0 -
Thank you so much. I do not have access to the server. I will try in Account Level Filter. 0 -
I dropped the anchors and it is working. Thanks again. 0
Please sign in to leave a comment.
Comments
3 comments