Currently, when we need to block incoming emails from specific providers with a history of abuse (such as HostPapa, ColoCrossing, and others), we must manually add large lists of IP ranges.
This process is time-consuming, hard to maintain, and not scalable.
The proposal is to allow ASN-based blocking (Autonomous System Number) within the cPFence email filtering module.
Key Benefits
Simplified management — a single ASN automatically covers all associated IP ranges.
Significant reduction in list size — no need to load thousands of individual IPs.
Automatic updates — when a provider adds new IPs under the same ASN, they remain blocked without manual intervention.
Higher efficiency against recurrent offenders involved in phishing, malware, or mass spam.
Better performance since the check is ASN-based rather than IP-based.
Suggested Implementation
Add a dedicated section in the panel (or CLI configuration) to manage blocked ASNs.
The system would internally resolve the IP ranges belonging to each ASN (via whois or local cache).
Allow setting a custom action for each block: reject, quarantine, or mark as spam.
Optionally, also support trusted ASN lists (whitelist) for reliable providers.
Practical Example
Instead of manually loading dozens of IP blocks like:
107.172.128.0/21
107.173.40.0/21
107.174.64.0/21
...
it would only be necessary to add:
AS46606 # ColoCrossing
and all IPs belonging to that ASN would be automatically blocked.