Skip to content

Greylisting tradeoffs on a cPanel mail server

How greylisting works on cPanel, where it helps, where it costs you legitimate mail, and how to tune the timeouts so the protection sticks without delaying first contact for hours.

Greylisting works on a simple bet: well-behaved mail servers retry temporary failures, badly-behaved spam emitters do not. On cPanel, enabling greylisting can drop inbound spam by 50–80% before it ever reaches SpamAssassin, with no content scanning required. The downside is the legitimate first-contact delay — anywhere from a few minutes to an hour while the sending server retries. For some workloads that’s invisible; for others it ruins user experience. Tuning the delay is what separates a good greylist from a frustrating one.

What’s happening

Greylisting works at the SMTP layer: on first contact from an unknown IP+sender+recipient tuple, the server returns a 451 temporary failure code. Legitimate sending servers respect the retry interval suggested in the response and try again after a few minutes — that retry is accepted. Spammers using direct-injection tools rarely retry, so they fail and disappear. The cost is that all first-time mail arrives delayed.

How to verify

Check whether greylisting is enabled in cPanel:

whmapi1 list_greylist_settings

If enabled, look at the current delay and whitelist:

whmapi1 list_greylist_trusted_hosts

Then observe real impact in logs:

grep "greylist" /var/log/exim_mainlog | tail -50

The fix

  1. Start with WHM > Mail > Greylisting to enable. cPanel’s default initial delay is 5 minutes — enough to defeat most direct-injection spam without making the delay painful.
  2. Tune the initial delay to your workload. B2B mail with patient counterparts can tolerate 10–15 minute delays for protection benefit. B2C mail with consumer Gmail counterparts is fine with 5 minutes. Anything above 30 minutes ages legitimate mail badly.
  3. Whitelist trusted senders. Add known-good partners’ IPs to the trusted hosts list so they bypass greylisting entirely. Microsoft 365 and Google Workspace IPs are obvious additions; smaller partners’ MX-listed IPs as you discover delay complaints.
  4. Use the auto-whitelist feature. cPanel tracks which IPs have successfully passed greylisting in the past and whitelists them for subsequent sends. This means greylisting only applies to first-ever contact, not every message.
  5. Watch for legitimate breakage. Some legitimate senders (cheap ESPs, broken corporate mail clusters) don’t retry well. Discovery is usually a user complaint that “I never got X’s mail.” Look in the log; if you see a greylist defer that wasn’t retried, whitelist that sender.
  6. Don’t combine aggressive greylisting with aggressive RBL rejection. Pick one or the other as your primary filter. Both stacked hard makes legitimate first-time mail very slow to arrive.

For environments where greylisting is part of a multi-layer defense and the tuning needs ongoing review, Stack Harbor sets the thresholds and maintains the whitelist as part of cPanel/WHM management.