If you're managing a cPanel server via WHM and want to prevent specific accounts from sending emails (e.g., due to abuse, spam, or policy violations), WHM provides a built-in way to restrict outbound email per user.
This guide explains how to block email-sending privileges for specific cPanel accounts on your Softsys Hosting VPS or Dedicated Server with WHM access.
Root access to WHM on your server
The server must be running Exim (default on cPanel/WHM)
There are several reasons to block a cPanel user from sending mail:
The account was compromised and is sending spam
The website has outdated scripts vulnerable to abuse
The client exceeds your email usage policy
You are performing maintenance and want to temporarily halt email activity
Log in to WHM as root:
👉 https://your-server-ip:2087/
In the search bar, type “Mail” and click on:
Mail Delivery Reports (optional – use to confirm spam issues)
To block an account, go to:
Home » Email » Mail Delivery Reports (for diagnostics)
Then proceed to:
Navigate to:
Home » Account Functions » Manage Account Suspension
Or alternatively, use the Exim configuration below.
/etc/cpanel_exim_system_filter
For more control, you can add rules directly in the Exim system filter to block email sending from specific users.
nano /etc/cpanel_exim_system_filter
Replace user_to_block
with the actual cPanel username:
if first_delivery
and ("$authenticated_id" is "user_to_block")
then
log_message = User user_to_block is not allowed to send emails
seen finish
endif
After updating the filter, restart Exim to apply changes:
/scripts/buildeximconf
service exim restart
Simply remove or comment out the blocking lines from the Exim filter, rebuild the Exim config, and restart the service.
Always inform the user before blocking, if possible.
Use email throttling or limit settings as an alternative in:
WHM » Tweak Settings » Mail
Regularly monitor outgoing mail logs using:
exigrep user@domain /var/log/