Set max emails per hour for a Domain on cPanel Server – Email sending limit

Set max emails per hour for a Domain on cPanel Server – Email sending limit

 
You must restrict max emails per hour for a cPanel account because it will prevent spammers/abusers from sending bulk emails from the server. Most of the shared hosting companies will set a hourly email sending limit for cPanel accounts. You must purchase a VPS or a dedicated server if you do not want maximum emails per hour restriction for your account.

How to change Maximum emails per hour for all domains on a cPanel server (Server-wide setting)

Do the below steps to set Maximum email limit per hour for all cPanel accounts on the server.

1. Login to WHM (Webhost Manager) using server root password

2. Search for “Tweak settings” in the WHM search box

3. Click on “Tweak Settings” under “Server Configuration”

Home » Server Configuration » Tweak Settings

4. Click on “Mail” tab in “Tweak Settings” and enter “Max hourly emails per domain”
 
max emails per hour cpanel
 
5. Save tweak settings after entering Max hourly emails limit
 

How to set Maximum emails per hour from server backend

You can do the above steps from server backend by editing the tweak settings file

1. Log into server via SSH as root

2. Edit Tweak settings file (/var/cpanel/cpanel.config) using vi editor

vi /var/cpanel/cpanel.config

3. Change “maxemailsperhour” to desired value

By default ‘maxemailsperhour’ value on cPanel server will be unlimited. Change it to maxemailsperhour=500

save the tweak setting file and exit

4. You must update tweak settings if you make any changes in the backend file

Command to update tweak settings : /usr/local/cpanel/whostmgr/bin/whostmgr2 --updatetweaksettings

Now you have set “Max hourly emails per domain” to 500 and this is a server-wide setting for all cPanel accounts.

How to change Max hourly emails limit for a single cPanel account

Do the below steps to set Max hourly emails limit for all domains in a cPanel account.

1. Login to WHM using server root login details

2. Click on “Modify an Account” under “Account Functions”

3. Select the domain from the dropdown and click on “Modify”
 
maximum emails per hour
 
4. Enter a value for “Maximum Hourly Email by Domain Relayed”
 
Maximum Hourly Emails
 
5. Click on “Save”

All domains under the cPanel account will be having the new hourly email limit. This is very helpful to restrict the number of emails sent from the account when there is spamming.

How to change Max hourly emails limit for an add-on domain

It is possible to change the Maximum hourly emails limit for a single domain in a cPanel account without restricting the whole cPanel account. You can set different limit for main domain and addon domain on the same cPanel account.

1. Login to server via SSH as ‘root’

2. Edit the file /var/cpanel/users/cpaneluser using vi editor

“cpaneluser” in the above line should be replaced with the actual cPaneluser

Example : vi /var/cpanel/users/martin

3. Add the line “MAX_EMAIL_PER_HOUR-AddOnDomain.com=500”

AddOnDomain.com in the above line should be replaced with actual add-on domain. Save the file and exit.

example : MAX_EMAIL_PER_HOUR-example.com=500

4. You must run /usr/local/cpanel/scripts/updateuserdomains after doing the above steps
 

If you edit this file directly you must run /usr/local/cpanel/scripts/updateuserdomains afterwards to rebuild the system caches.
# If you edit MAX_EMAIL_PER_HOUR or MAX_EMAIL_PER_HOUR-[domain] you must run /usr/local/cpanel/scripts/updateuserdomains’