cPanel Email Filter for IP Range

I recently needed to block a large amount of incoming email via IP range in cPanel for a single account versus blocking the IP range on the entire server. This was accomplished using cPanel’s Account Level Filtering for Mail.

Here is the filter setting using 192.168.0.0/24 as an example.

Rules:
Any Header
matches regex
192\.168\.\d{1,3}\.\d{1,3}

Action:
Discard Message

cpanel mail filter