How to Configure the Maximum Emails Per Hour in cPanel
Introduction
cPanel allows administrators to limit the number of emails that can be sent per hour to help prevent spam, reduce the risk of compromised accounts sending bulk emails, and maintain the server’s email reputation. These limits can be configured at the server level or for individual domains.
Prerequisites
- Root access to the server or a user with sudo privileges.
- SSH access to the cPanel server.
- Basic knowledge of Linux command-line operations.
- cPanel/WHM installed on the server.
Procedure
Server-Wide Email Limit
Step 1: Log in to the server via SSH.
Connect to the server as the root user or a sudo-privileged user.
Step 2: Configure the server-wide email limit.
Edit the following file:
/var/cpanel/maxemailsperhour
Enter the maximum number of emails that all accounts are allowed to send per hour. For example:
500
Domain-Level Email Limit
Step 3: Configure the email limit for a specific domain.
Navigate to the following directory:
/var/cpanel/maxemailsperdomain
Create a file with the same name as the domain. For example, for example.com:
touch /var/cpanel/maxemailsperdomain/example.com
Step 4: Set the email limit.
Edit the domain file and specify the maximum number of emails the domain can send per hour.
Example:
200
This limits example.com to sending 200 emails per hour.
Step 5: Apply the changes.
After updating the configuration files, rebuild the email configuration by running:
/scripts/build_maxemails_config
This command applies the updated email limits.
Conclusion
Configuring email sending limits in cPanel helps protect the server from spam, prevents abuse by compromised accounts, and improves email deliverability. You can configure limits globally for the entire server or individually for each domain. After making any changes, always run the build_maxemails_config script to ensure the new settings are applied successfully.
