The Best Price for IPv4/IPv6 Lease – Any RIR & Any Geo-LocationOrder Now
Hostperl

Configure Email Rate Limiting in cPanel: Stop Spam Abuse

By Raman Kumar

Share:

Updated on Jun 3, 2026

Configure Email Rate Limiting in cPanel: Stop Spam Abuse

Understanding Email Rate Limiting in cPanel

Email rate limiting controls how many messages your server processes within specific timeframes. Without proper limits, compromised accounts can blast thousands of spam messages through your server. This destroys your IP reputation and lands legitimate emails in spam folders.

cPanel provides several rate limiting mechanisms through its mail server configuration. The primary tools include Exim's rate limiting features and built-in mail delivery controls. These prevent abuse while maintaining normal email flow.

Rate limiting works by tracking message counts per user, domain, and IP address. When limits are exceeded, the system either delays delivery, rejects messages, or queues them for later processing. This protects your server from becoming a spam relay. It also ensures business-critical emails reach their destination.

Prerequisites for Email Rate Configuration

You'll need root access to your VPS hosting server and WHM administrator privileges. Basic familiarity with cPanel's mail configuration interface helps. We'll walk through each step though.

Check your current Exim version before starting:

exim -bV

Modern cPanel installations use Exim 4.97 or newer. This includes comprehensive rate limiting capabilities. If you're running an older version, consider updating through WHM's EasyApache interface.

Backup your existing Exim configuration:

cp /etc/exim.conf /etc/exim.conf.backup.$(date +%Y%m%d)

Setting Up Basic Rate Limits in WHM

Log into WHM as root. Navigate to "Service Configuration" → "Exim Configuration Manager". The Basic Editor provides simple rate limiting options suitable for most hosting environments.

Under the "Mail" section, locate "Mail per hour per domain limit". Set this to 300 for shared hosting accounts or 1000 for business clients. This prevents individual domains from overwhelming your mail queue.

Configure "Mail per hour per email account" to 100 messages. This catches compromised user accounts before they can send significant spam volumes. Legitimate users rarely send more than 100 emails hourly.

Set "Defer if over Mail/Hour limits" to "On". This queues excess messages instead of rejecting them outright. Legitimate bulk senders get time to spread their mailings across longer periods.

Click "Save" to apply these settings. The changes take effect immediately without restarting Exim.

Advanced Rate Limiting with Exim Configuration

For more granular control, edit the Exim configuration directly. Navigate to WHM → "Service Configuration" → "Exim Configuration Manager" → "Advanced Editor".

Add these rate limiting directives to the appropriate sections:

# Rate limiting for authenticated users
begin acl
check_auth_relay:
  # Limit to 50 messages per hour per user
  defer condition = ${if >{$sender_rate}{50}}
        message = Sender rate overlimit - $sender_rate messages per hour
  accept

Configure domain-specific limits in the RCPT ACL:

# Per-domain rate limiting
check_recipient:
  defer domains = +local_domains
        ratelimit = 200 / 1h / per_mail / $sender_address_domain
        message = Domain rate limit exceeded: $sender_rate_msg
  accept

These settings limit individual domains to 200 messages per hour. They track rates per sender address domain. Adjust the numbers based on your server capacity and client needs.

The email delivery optimization guide explains how rate limiting affects overall SMTP performance.

Monitoring and Adjusting Rate Limits

Check your mail queue regularly to spot rate limiting effects:

exim -bp | grep "rate limit"

Review Exim logs for rate limiting messages:

grep "rate.*overlimit" /var/log/exim_mainlog

Monitor which accounts trigger limits most frequently:

grep "rate limit" /var/log/exim_mainlog | awk '{print $7}' | sort | uniq -c | sort -nr

This shows sender addresses ordered by rate limit violations. Accounts appearing frequently may need investigation for compromise. They might also have legitimate high-volume requirements.

Adjust limits based on actual usage patterns. E-commerce sites might need higher limits during sales events. Personal hosting accounts rarely require more than default settings.

Configure Email Rate Limiting in cPanel for Individual Accounts

Individual cPanel accounts can have custom rate limits through the "Email Deliverability" interface. Navigate to cPanel → "Email" → "Email Deliverability".

Click "Manage" next to any domain to access per-account settings. Here you can set domain-specific hourly limits. These override server defaults.

For shared hosting clients, consider these typical limits:

  • Personal websites: 50 emails per hour
  • Small business: 200 emails per hour
  • Newsletter publishers: 500-1000 emails per hour
  • E-commerce sites: 1000+ emails per hour

Document these settings in your client management system. Rate limits often need adjustment during promotional campaigns or product launches.

The cPanel email authentication tutorial shows how proper SPF, DKIM, and DMARC records work alongside rate limiting. Together they provide comprehensive email security.

Handling Rate Limit Exceptions

Some legitimate applications need higher sending volumes. Create whitelist entries for trusted sources in the Exim configuration:

# Whitelist specific authenticated users
begin acl
check_auth_relay:
  accept authenticated = *
         condition = ${if match{$authenticated_id}{^(newsletter|bulk)@}}
         logwrite = Whitelisted bulk sender: $authenticated_id
  
  defer condition = ${if >{$sender_rate}{50}}
        message = Sender rate overlimit

This example allows accounts starting with "newsletter" or "bulk" to bypass rate limits entirely. Use this carefully to avoid creating spam relay opportunities.

For temporary exceptions during legitimate bulk sends, create time-based overrides:

# Allow higher limits during business hours
defer condition = ${if and{{>{$sender_rate}{100}}{<{$tod_hour}{18}}{>{$tod_hour}{8}}}}
      message = Business hours rate limit: 100/hour

This permits 100 messages per hour during business hours (8 AM to 6 PM). It maintains stricter limits at other times.

Troubleshooting Common Rate Limiting Issues

Legitimate emails getting deferred indicates overly aggressive limits. Check the mail queue for patterns:

exim -bp | grep -A2 "rate limit"

If automated systems trigger limits frequently, consider dedicated IP addresses for high-volume senders. This isolates their reputation from other domains on your server.

WordPress sites often hit limits during comment notifications or password resets. Configure these applications to use external SMTP services for transactional emails. Keep promotional emails on your server.

Test rate limits with controlled sending:

# Send test messages to trigger limits
for i in {1..60}; do
  echo "Test message $i" | mail -s "Rate test $i" test@example.com
  sleep 60
done

Monitor logs during this test. Verify limits work as expected without blocking legitimate traffic.

Proper email rate limiting protects your server reputation while maintaining reliable delivery for legitimate messages. Hostperl shared hosting includes pre-configured rate limits optimized for most websites. For higher-volume needs, our VPS hosting solutions provide full control over email configuration and sending limits.

Frequently Asked Questions

What happens when rate limits are exceeded?

Messages are typically deferred (queued for later delivery) rather than rejected. Exim retries delivery according to its retry schedule, usually within a few hours. This prevents legitimate emails from being lost while controlling spam volume.

Can I set different limits for different email accounts?

Yes, cPanel allows per-domain and per-account rate limiting. You can use both WHM global settings and individual account configurations. Business accounts often need higher limits than personal websites.

How do rate limits affect mailing list software?

Mailing list applications should use proper SMTP authentication and respect server limits. Consider external email services for large newsletters. You can also configure dedicated IP addresses with appropriate rate limits for bulk sending.

Do rate limits apply to incoming mail?

No, these limits only affect outbound mail from your server. Incoming mail filtering uses different mechanisms. These include SpamAssassin and mail header analysis rather than rate limiting.

How often should I review rate limit settings?

Check monthly during normal operations. Check immediately when clients report delivery issues. Adjust limits before planned bulk mailings or promotional campaigns. This prevents legitimate messages from being deferred.