Mail Limiting Features

For WHM version 11.38

We have added some new features and improved some older features that allow you to regulate outgoing mail. You can use these features to limit bandwidth consumption and prevent potential spammers.

This document will focus on 4 features and how you can use these features together to prevent spam.

Feature Location Description
Max hourly emails per domain Tweak Settings >> Mail This option allows you to limit the number of messages domains that you own can send.
Count mailman deliveries towards a domain's Max hourly emails Tweak Settings >> Mail This option allows you to count messages sent to Mailman mailing lists against an account's Max hourly emails per domain limit. By default, this setting is Off.
The percentage of email messages (above the account's hourly maximum) to queue and retry for delivery Tweak Settings >> Mail This percentage is compared against the Max Hourly Emails value. By default, when a user exceeds the number of emails the domain can send per hour, additional messages are queued to be sent later. This setting allows you to specify a point at which any additional outgoing messages will be ignored.
Maximum percentage of failed or deferred messages a domain may send per hour Tweak Settings >> Mail This option allows you to specify the percentage of failed or deferred messages domain can send before it is temporarily prevented from sending mail. The percentage you specify here is compared to the total number of outgoing messages from the domain.

Max hourly emails per domain

This option allows you to limit the number of messages domains can send. You can enable this feature on the WHM Tweak Settings screen by stipulating a value for the Mail setting labeled Max hourly emails. This value will become the default threshold for all of the domains on the system. This configuration option is only available to the root user and to resellers that have root privileges. The configuration data for this option is stored in /var/cpanel/cpanel.config. When you change this option setting, it will affect every domain hosted on the server.

You may further refine this setting using the Home >> Packages features to add and edit packages or Home >> Account Functions >> Modify an Account feature to edit this setting for individual cPanel accounts. Configuration data for packages is stored in /var/cpanel/packages/. Configuration data for users is stored in /var/cpanel/users/.

Resellers are able to modify the Max hourly emails per domain and The percentage of email messages (above the account’s hourly maximum) to queue and retry for delivery settings for accounts and packages they own if the Allow Creation of Packages with non-default Email Limits permission is enabled. You can enable or disable the permission for resellers using the Home >> Resellers >> Edit reseller privileges & nameservers feature.

Image of The Max hourly emails per domain
The Max hourly emails per domain

Specifying max hourly emails per domain for individual domains

You can specify the Max hourly emails per domain value for individual domains using the Max hourly emails per domain feature in WHM or the command line:

User Interface

  1. Log in to the main account.
  2. Under the Server Configuration section to the left of the screen, select Tweak Settings.
  3. Click the Mail tab in Tweak Settings.
  4. Scroll down to find Max hourly emails per domain.
    1. There are two options for this feature:
      1. If you wish for your domains to receive unlimited emails, select the button next to the Unlimited option. This is the default option.
      2. If you wish to limit the number of emails your domain can receive every hour, select the button next to the blank field. Input a number in the blank field. This number represents the maximum number of emails your domain can receive in an hour.
  5. When you are done making changes, scroll to the bottom of the page and click the Save button.

Command Line

You can specify the Max hourly emails per domain value for individual domains using the command line:

  1. Log in as the root user.
  2. Locate the cPanel user who owns the domain you wish to limit in /var/cpanel/users/. This directory contains user configuration data. When you have located the user, open the corresponding cpuser file with your preferred text editor.
  3. Add a MAX_EMAIL_PER_HOUR-[$domain] key to the cpuser file you wish to edit and specify a value for the key (e.g. MAX_EMAIL_PER_HOUR-[example.com]=250). If the cPanel user owns more than one domain, you can specify multiple keys. When you are finished editing the cpuser file, save your changes and exit the text editor.
  4. Run the /usr/local/cpanel/scripts/updateuserdomains script to update the user configuration data.

At this point, the limit you specified in the MAX_EMAIL_PER_HOUR-[$domain] key will be applied to the domain(s).

After configuring the Max hourly emails, you should also configure The percentage of email messages (above the account's hourly maximum) to queue and retry for delivery option.

Count mailman deliveries towards a domain's Max hourly emails

To select whether or not you wish to count mailman deliveries against a domain's Max hourly emails per domain limit, use the Count mailman deliveries towards a domain's Max hourly emails option in Tweak Settings >> Mail.

When this option is set to On, email messages sent via a mailing list will count against the domain's Max hourly emails per domain limit. The default setting is Off.

The percentage of email messages (above the account’s hourly maximum) to queue and retry for delivery

This configuration option allows you to define how overages are handled when a domain exceeds the maximum number of emails allowed per hour. By default, additional messages are queued for delivery and sent in the next hour. This option is only available to the root user and to resellers that have root privileges. The configuration data for this option is stored in /var/cpanel/cpanel.config.

The value you configure here is compared against the value set in Max hourly emails per domain to determine whether an outgoing message should be queued and resent later or discarded. For example, if you set this value to 125%, then once the domain reaches its hourly limit, Exim will queue any additional messages, up to 125% of the Max hourly emails per domain value. Once the account reaches 125% of the Max hourly emails per domain value, any additional outgoing messages are discarded.

You may use this feature to discard all outgoing messages once the domain has reached its limit by setting the The percentage of email messages (above the account’s hourly maximum) to queue and retry for delivery value to 100.

Image of 'The percentage of email messages (above the account's hourly maximum) to queue and retry for delivery
The percentage of email messages (above the account's hourly maximum) to queue and retry for delivery

Example

Setting the Max hourly emails per domain option to 500 would allow each of the domains you host to send 500 email messages per hour. Now, let's assume one of your domains uses a mailing list with 500 members. If this domain sends a message to the mailing list, then sends an additional 25 email messages in the same hour, the domain would exceed the Max hourly emails per domain limit. In this scenario, a domain is sending a high volume of messages; however, these messages are not spam.

For this reason, you can specify a "soft limit" using the The percentage of email messages (above the account’s hourly maximum) to queue and retry for delivery option. If, for example, you have set the The percentage of email messages (above the account’s hourly maximum) to queue and retry for delivery value to 150, the domain can queue up to 250 messages to send in the next hour. In this scenario, the domain is able to queue the additional 25 email messages to send in the next hour.

Maximum percentage of failed or deferred messages a domain may send per hour

This option allows you to specify the percentage of failed or deferred messages a domain can send before it is temporarily prevented from sending mail. The system examines outgoing mail over the last hour to determine whether the domain has exceeded the limit. When a domain exceeds the limit, it cannot send mail until enough time has passed so that the domain is under the limit.

For example, if we specify a value of 50 here, this value indicates that no more than 50% of outgoing messages from the domain can receive a failed or deferred response. In the event that the domain sends 100 messages, and 51 of them return a failed or deferred response, the domain will be unable to send mail until the account is under the 50% threshold for the last hour.

The configuration data for this option is stored in /var/cpanel/cpanel.config and applies to every domain hosted by your server.

Image of Maximum percentage of failed or deferred messages a domain may send per hour
Maximum percentage of failed or deferred messages a domain may send per hour

Topic revision: r17 - 25 Jan 2013 - 17:06:20 - Main.LaurenceSimon
AllDocumentation/WHMDocs.MailLimitingFeatures moved from Sandbox.11_32MailDelimiter on 14 Feb 2012 - 17:37 by Main.JustinSchaefer - put it back