Skip to content

Outbound throttling by user, domain, and shared IP on cPanel

How to stack outbound mail throttles at three levels on a cPanel server — per authenticated user, per domain, per shared IP — so one runaway mailbox cannot blow through every limit at once.

A single outbound throttle isn’t enough. Limit only per user, and a compromised account that rotates through several authenticated users still floods. Limit only per domain, and a single user inside that domain can saturate the whole quota in minutes. Limit only at the IP level, and you discover the limit when ten domains are all hitting it simultaneously. The right approach stacks three independent throttles — user, domain, IP — each with its own threshold, so the first one to trip stops the bleeding.

What’s happening

cPanel exposes outbound throttling at the domain level via WHM > Tweak Settings > “Max hourly emails per domain”. That’s one tier. Exim’s ACL ratelimit condition (see the ACL throttle KB) handles per-user limits. The IP-level limit lives in Exim’s smtp_accept_max_per_connection, queue_run_max, and a custom ACL on $sender_host_address. Each tier is independent — a user can hit their limit without affecting the domain budget, and the domain can hit its limit without exhausting the IP.

How to verify

Inspect the active configuration:

grep -E "(MAILMAX|max_emails)" /var/cpanel/cpanel.config
exim -bP | grep -E "(smtp_accept_max|queue_run_max)"
grep "ratelimit" /etc/exim.conf.local

Then check live counters for users currently over threshold:

grep "ratelimit" /var/log/exim_mainlog | tail
exim -bp | awk '{print $4}' | grep -v "^$" | sort | uniq -c | sort -rn | head

The fix

  1. Set the domain-level cap in WHM > Tweak Settings. Set “Max hourly emails per domain” to a reasonable ceiling — for a typical SMB domain, 200–500 per hour. The user gets an immediate visible signal in their cPanel dashboard when they approach the limit.
  2. Set per-user ACL throttles in /etc/exim.conf.local (see the submission throttle KB for syntax). 60 per hour per authenticated user is a sensible starting point; raise per user for those who legitimately need it.
  3. Cap the IP-level throughput with smtp_accept_max_per_host (limits simultaneous connections from one host) and a custom ACL that counts outbound deliveries per IP per minute. This stops a compromise that spans multiple accounts.
  4. Configure alerting at each tier. A user hitting their limit is a signal; a domain hitting its limit is a stronger signal; an IP hitting its limit means several domains are simultaneously problematic and you have a server-wide issue.
  5. Document the layered limits so support, ops, and the next on-call all know which limit is responsible when a customer complains about deferred mail. Without documentation, the wrong limit gets raised.

For environments where outbound abuse has happened more than once and the prevention layer needs to be deliberate, Stack Harbor builds the layered throttle into cPanel/WHM management on initial setup.