A blocklist notification claiming the server is an “open relay” is rarely literal. cPanel’s Exim has been closed-relay by default for over a decade. What is usually happening: a compromised cPanel account is sending authenticated mail, or a script in public_html is calling sendmail directly, and a reputational feed has scored the IP. The fix is account-level, not Exim-level — but a few Exim tightenings reduce the blast radius.
What’s happening
Exim accepts mail in three modes: relay from authenticated senders, relay from trusted IPs (relay_hosts in cPanel), and acceptance of inbound mail for hosted domains. None of those are open-relay behavior. The bad pattern is a compromised cPanel account whose owner’s mailbox credentials are stolen, or a webshell using PHP mail() which Exim accepts from localhost without further auth.
How to verify
exim -bV
exim -bh 1.2.3.4 < /dev/null 2>&1 | grep -E "(Accepted|Reject|relay)"
swaks --to test@external-domain.com --from spoof@external-domain.com --server your-host -tls 2>&1 | tail -10
exim -bp | wc -l
grep -E "503|550" /var/log/exim_mainlog | head
exim -bh 1.2.3.4 <enter-test-message> is the canonical open-relay test. If it accepts mail to an external domain from an unauthenticated remote, you have a real problem.
The fix
- Confirm not an open relay:
swaks --to ...from outside, unauthenticated, with sender and recipient both external. Should reject with550orrelay not permitted. If accepted, you have a misconfiguration — open a cPanel support ticket immediately. - Find the actual spammer: tail
exim_mainlog, grep forcwd=to find which directory the message originated from, identify the user. - Suspend that account following the postmortem-friendly workflow. Preserve evidence first.
- WHM > Exim Configuration Manager:
Maximum number of failed or deferred messages a domain can have before its mail is rate-limited: tighten if neededRestrict outgoing SMTP to root, exim, and mailman(the famoussmtp_restriction): on. This prevents webshells from making direct SMTP connections to external servers.Track email origin via X-Source headers: on. AddsX-Source-Argsto outbound mail, making post-incident attribution trivial.
PHP mail() per-user limit: in WHM > Tweak Settings, setmax emails per hour per account. 100 is typically generous.- Mail account passwords: enforce minimum strength 70+ for mail accounts specifically. Most spammer-via-cPanel incidents are weak mail passwords.
- Get off the blocklist: most blocklists have a self-service delisting form. Submit only after the spam has stopped — they re-list aggressively.
Stack Harbor handles mail-reputation incidents under cPanel/WHM management.