Skip to content

Offloading spam scanning to MX-level filtering ahead of cPanel

When to put a dedicated MX-level spam filter (Proofpoint, Mimecast, Spam Experts, or self-hosted Rspamd) in front of a cPanel server, and how to wire it so cPanel sees only clean mail.

A cPanel server handling tens of thousands of inbound messages a day with SpamAssassin and RBLs spends meaningful CPU on spam scanning that never matters — the spam gets rejected, but the cost is the operator’s. Offloading scanning to an MX-level filter (a service that accepts mail at your MX and forwards only the clean stream to cPanel) reduces the load, improves the catch rate, and centralizes spam policy. The transition needs care because MX changes affect every inbound message.

What’s happening

An MX-level filter takes over the role of being the public-facing MX for the domain. Mail arrives at the filter, which scans, scores, and decides whether to forward to your cPanel server. The cPanel server’s Exim still receives, but only from the filter’s IP range, and the mail it receives is already deemed clean. You can either keep cPanel doing a second pass (defense in depth) or trust the filter entirely (lower load, higher dependency).

How to verify

Confirm the current MX setup for a domain:

dig +short MX example.com

If the MX points at the cPanel server directly, you have no front-end filtering. Send a test message and watch:

tail -f /var/log/exim_mainlog | grep "<="

You should see mail arriving directly from sender IPs, not from a filter’s range.

The fix

  1. Pick the filtering provider. Proofpoint and Mimecast for enterprise (highest cost, strongest catch); SpamExperts and MailRoute for mid-market; self-hosted Rspamd or another open-source filter for cost-sensitive environments.
  2. Provision the filter with the domains to handle. The provider gives you an MX hostname to publish, and a forwarding destination — typically your cPanel server’s mail hostname (mail.example.com direct to cPanel’s IP).
  3. Update DNS MX records to point at the filter, with a TTL low enough that you can roll back quickly if needed.
  4. Restrict cPanel’s inbound to accept only from the filter’s IP range. WHM > Exim Configuration Manager > Advanced Editor, add an ACL that requires the connecting IP to match the filter’s published ranges (or set the firewall to drop port 25 from anywhere except the filter).
  5. Disable or downscale SpamAssassin and RBLs on cPanel if you trust the filter. Defense in depth says keep them at lower thresholds; cost-saving says shut them off. The decision depends on your risk tolerance and the filter’s catch rate.
  6. Monitor delivery for two weeks after cutover. Some legitimate mail will be quarantined by the filter — you need a process to release it. The release UI is the daily-use tool; have users trained on it.

For environments where MX-level filtering is part of a broader mail-security posture, Stack Harbor handles the filter selection, the wiring, and the cutover under deployment management.