{"id":460,"date":"2021-07-23T12:30:22","date_gmt":"2021-07-23T12:30:22","guid":{"rendered":"https:\/\/ssdsunucum.com\/blog\/how-to-prevent-spam-with-mail-limiting-features\/"},"modified":"2021-07-23T12:30:22","modified_gmt":"2021-07-23T12:30:22","slug":"how-to-prevent-spam-with-mail-limiting-features","status":"publish","type":"post","link":"https:\/\/ssdsunucum.com\/blog\/how-to-prevent-spam-with-mail-limiting-features\/","title":{"rendered":"How to Prevent Spam with Mail Limiting Features"},"content":{"rendered":"<\/p>\n<div class=\"col-md-9\">\n<div class=\"flex-column flex-md-row article-header\"><\/div>\n<hr>\n<h2 id=\"overview\">Overview<\/h2>\n<p>The <em>Mail<\/em> section of WHM\u2019s <em>Tweak Settings<\/em> interface (<em>WHM &gt;&gt; Home &gt;&gt; Server Configuration &gt;&gt; Tweak Settings<\/em>) contains five options that allow you to limit outgoing mail. The limits that these options set apply to all domains on the server. Use the options to help limit bandwidth consumption and prevent potential spammers.<\/p>\n<div class=\"callout callout-warning\">\n<div class=\"callout-heading\">Important:<\/div>\n<div class=\"callout-content\">\n<p>You <strong>must<\/strong> enable the Eximstats driver in WHM\u2019s <em>Service Manager<\/em> interface (<em>WHM &gt;&gt; Home &gt;&gt; Service Configuration &gt;&gt; Service Manager<\/em>) to use the following features.<\/p>\n<\/p><\/div>\n<\/div>\n<h2 id=\"total-emails-sent-by-a-domain-per-hour-options\">Total emails sent by a domain per hour options<\/h2>\n<p>The following options apply to the total number of outgoing messages that a domain sends per hour.<\/p>\n<h3 id=\"max-hourly-emails-per-domain\">Max hourly emails per domain<\/h3>\n<p>The <em>Max hourly emails per domain<\/em> option limits the number of messages that a domain can send per hour.<\/p>\n<h4 id=\"attributes\">Attributes<\/h4>\n<ul>\n<li>\n<p><code>cpanel.config<\/code> entry: <code>maxemailsperhour<\/code><\/p>\n<\/li>\n<li>\n<p>Default value: <code>Unlimited<\/code> (no value)<\/p>\n<\/li>\n<li>\n<p>Minimum value: <code>1<\/code><\/p>\n<\/li>\n<li>\n<p>Maximum value: <code>Unlimited<\/code> (no value)<\/p>\n<\/li>\n<li>\n<p>Permissions: \u2014 A user with either of the following permissions can access this option:<\/p>\n<ul>\n<li>A reseller account, if you enable the <em>Allow Creation of Packages with non-default Email Limits<\/em> option in WHM\u2019s <em>Edit Reseller Nameservers and Privileges<\/em> interface (<em>WHM &gt;&gt; Home &gt;&gt; Resellers &gt;&gt; Edit Reseller Nameservers and Privileges<\/em>)<\/li>\n<li>A user with <code>root<\/code>-level privileges.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<div class=\"callout callout-info\">\n<div class=\"callout-heading\">Note:<\/div>\n<div class=\"callout-content\">\n<ul>\n<li>\n<p>To define a maximum number of emails that the server allows for an account package, use WHM\u2019s <em>Edit a Package<\/em> interface (<em>WHM &gt;&gt; Home &gt;&gt; Packages &gt;&gt; Edit a Package<\/em>).<\/p>\n<\/li>\n<li>\n<p>To define a maximum number of emails that the server allows for an individual cPanel account, use WHM\u2019s <em>Modify an Account<\/em> interface (<em>WHM &gt;&gt; Home &gt;&gt; Account Functions &gt;&gt; Modify an Account<\/em>).<\/p>\n<\/li>\n<\/ul><\/div>\n<\/div>\n<h3 id=\"count-mailman-deliveries-towards-a-domain-s-max-hourly-emails\">Count mailman deliveries towards a domain\u2019s Max hourly emails<\/h3>\n<p>This setting allows you to specify whether to count messages sent to <em>Mailman mailing lists against an account\u2019s Max hourly emails per domain<\/em> limit.<\/p>\n<ul>\n<li>\n<p>Set this option\u2019s value to <em>On<\/em> to include Mailman deliveries in the total value that a domain\u2019s <em>Max hourly emails per domain<\/em> option uses.<\/p>\n<\/li>\n<li>\n<p>Set this option\u2019s value to <em>Off<\/em> to exclude Mailman deliveries from the total value.<\/p>\n<\/li>\n<\/ul>\n<h4 id=\"attributes-1\">Attributes<\/h4>\n<ul>\n<li>\n<p><code>cpanel.config<\/code> entry: <code>email_send_limits_count_mailman<\/code><\/p>\n<\/li>\n<li>\n<p>Default value: <em>Off<\/em><\/p>\n<\/li>\n<li>\n<p>Permissions: A user with <code>root<\/code>-level permissions can access this option.<\/p>\n<\/li>\n<\/ul>\n<h3 id=\"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\u2019s hourly maximum) to queue and retry for delivery<\/h3>\n<p>This option defines how the mail server handles outgoing messages for a domain that reaches the value of the <em>Max hourly emails per domain<\/em> option. The mail server will attempt to deliver any queued messages in the next hour, by default.<\/p>\n<ul>\n<li>\n<p>To discard all additional outgoing messages for a domain after the domain reaches the value of the <em>Max hourly emails per domain<\/em> option, enter <code>100<\/code> in the <em>The percentage of email messages (above the account\u2019s hourly maximum) to queue and retry for delivery<\/em> text box.<\/p>\n<\/li>\n<li>\n<p>To queue outgoing messages for a domain after the domain reaches the value of the <em>Max hourly emails per domain<\/em> option, enter a value larger than <code>100<\/code> in the <em>The percentage of email messages (above the account\u2019s hourly maximum) to queue and retry for delivery<\/em> text box.<\/p>\n<\/li>\n<\/ul>\n<div class=\"callout callout-warning\">\n<div class=\"callout-heading\">Important:<\/div>\n<div class=\"callout-content\">\n<p>The mail server evaluates the value that you enter in the <em>The percentage of email messages (above the account\u2019s hourly maximum) to queue and retry for delivery<\/em> text box as a percentage of the value that you set for the <em>Max hourly emails per domain<\/em> option.<\/p>\n<\/p><\/div>\n<\/div>\n<h4 id=\"attributes-2\">Attributes<\/h4>\n<ul>\n<li>\n<p><code>cpanel.config<\/code> entry: <code>email_send_limits_defer_cutoff<\/code><\/p>\n<\/li>\n<li>\n<p>Default value: <code>125<\/code><\/p>\n<\/li>\n<li>\n<p>Minimum value: <code>100<\/code><\/p>\n<\/li>\n<li>\n<p>Maximum value: <code>10000<\/code><\/p>\n<\/li>\n<li>\n<p>Permissions: A user with <code>root<\/code>-level permissions can access this option.<\/p>\n<\/li>\n<\/ul>\n<h4 id=\"example\">Example<\/h4>\n<p>You set the <em>Max hourly emails per domain<\/em> option to <code>100<\/code>, and you set the <em>The percentage of email messages (above the account\u2019s hourly maximum) to queue and retry for delivery<\/em> option to <code>200<\/code>. The mail server applies the following rules to the outgoing messages from each domain:<\/p>\n<ul>\n<li>\n<p>The mail server sends the first 100 outgoing messages from the domain.<\/p>\n<\/li>\n<li>\n<p>The mail server queues the next 100 outgoing messages from the domain.<\/p>\n<\/li>\n<li>\n<p>The mail server discards any additional outgoing messages from the domain.<\/p>\n<\/li>\n<li>\n<p>In the following hour, the mail server attempts to send all queued outgoing messages from the domain.<\/p>\n<\/li>\n<\/ul>\n<h2 id=\"total-emails-sent-by-an-email-account-per-hour-options\">Total emails sent by an email account per hour options<\/h2>\n<p>The following options apply to the total number of outgoing messages that an individual email account sends per hour.<\/p>\n<h3 id=\"number-of-unique-recipients-per-hour-to-trigger-potential-spammer-notification\">Number of unique recipients per hour to trigger potential spammer notification.<\/h3>\n<p>The <em>Number of unique recipients per hour to trigger potential spammer notification.<\/em> setting specifies the number of emails that any account may send in one hour before the system sends an alert notification.<\/p>\n<p>If an email account exceeds this threshold and the system administrator has enabled the <em>Large Amount of Outbound Email Detected<\/em> alert in WHM\u2019s <em>Contact Manager<\/em> interface (<em>WHM &gt;&gt;  Home &gt;&gt; Server Contacts &gt;&gt; Contact Manager<\/em>), the system will send an alert to the system administrator.<\/p>\n<h2 id=\"failed-and-deferred-outgoing-message-options\">Failed and deferred outgoing message options<\/h2>\n<p>The <em>Maximum percentage of failed or deferred messages a domain may send per hour option and the Number of failed or deferred messages a domain may send before protections can be triggered<\/em> option specifies when the server will temporarily block outgoing mail from a domain. The system examines <strong>all<\/strong> outgoing and local mail over the previous hour to determine whether these conditions are true.<\/p>\n<div class=\"callout callout-warning\">\n<div class=\"callout-heading\">Important:<\/div>\n<div class=\"callout-content\">\n<p>Your server will temporarily block outgoing mail from a domain if <strong>both<\/strong> of the following conditions are true:<\/p>\n<ul>\n<li>\n<p>The percentage of failed or deferred messages, out of the total number of messages that the domain sent, is <strong>equal to or greater than<\/strong> the percentage that you specify for the <em>Maximum percentage of failed or deferred messages a domain may send per hour<\/em> option.<\/p>\n<\/li>\n<li>\n<p>The domain has sent <strong>at least<\/strong> the number of failed or deferred messages that you specify for the <em>Number of failed or deferred messages a domain may send before protections can be triggered<\/em> option.<\/p>\n<\/li>\n<\/ul><\/div>\n<\/div>\n<h4 id=\"example-1\">Example<\/h4>\n<div class=\"collapse-wrapper\">\n<p>        Click to view&#8230;<\/p>\n<div class=\"collapse\" id=\"click-to-view---1626990176499823368\">\n<div class=\"card card-body\">\n<p>If you set the following values, the server functions in the manner that the table below describes:<\/p>\n<ul>\n<li>\n<p><em>Maximum percentage of failed or deferred messages a domain may send per hour<\/em> \u2014 <code>55%<\/code><\/p>\n<\/li>\n<li>\n<p><em>Number of failed or deferred messages a domain may send before protections can be triggered<\/em> \u2014 <code>7<\/code><\/p>\n<\/li>\n<\/ul>\n<table>\n<thead>\n<tr>\n<th align=\"left\">Deferred or failed (past hour)<\/th>\n<th align=\"left\">Successful (past hour)<\/th>\n<th align=\"left\">% deferred or failed<\/th>\n<th align=\"left\">Domain\u2019s outgoing mail status<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td align=\"left\">1<\/td>\n<td align=\"left\">0<\/td>\n<td align=\"left\">100%<\/td>\n<td align=\"left\">OK \u2014 The domain reached the <strong>percentage<\/strong> of failed or deferred messages, but did <strong>not<\/strong> reach the <strong>number<\/strong> of failed or deferred messages.<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">2<\/td>\n<td align=\"left\">0<\/td>\n<td align=\"left\">100%<\/td>\n<td align=\"left\">OK \u2014 The domain reached the <strong>percentage<\/strong> of failed or deferred messages, but did <strong>not<\/strong> reach the <strong>number<\/strong> of failed or deferred messages.<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">2<\/td>\n<td align=\"left\">1<\/td>\n<td align=\"left\">67%<\/td>\n<td align=\"left\">OK \u2014 The domain reached the <strong>percentage<\/strong> of failed or deferred messages, but did <strong>not<\/strong> reach the <strong>number<\/strong> of failed or deferred messages.<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">2<\/td>\n<td align=\"left\">2<\/td>\n<td align=\"left\">50%<\/td>\n<td align=\"left\">OK \u2014 The domain did <strong>not<\/strong> reach either condition.<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">3<\/td>\n<td align=\"left\">2<\/td>\n<td align=\"left\">60%<\/td>\n<td align=\"left\">OK \u2014 The domain reached the <strong>percentage<\/strong> of failed or deferred messages, but did <strong>not<\/strong> reach the <strong>number<\/strong> of failed or deferred messages.<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">4<\/td>\n<td align=\"left\">2<\/td>\n<td align=\"left\">67%<\/td>\n<td align=\"left\">OK \u2014 The domain reached the <strong>percentage<\/strong> of failed or deferred messages, but did <strong>not<\/strong> reach the <strong>number<\/strong> of failed or deferred messages.<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">5<\/td>\n<td align=\"left\">2<\/td>\n<td align=\"left\">71%<\/td>\n<td align=\"left\">OK \u2014 The domain reached the <strong>percentage<\/strong> of failed or deferred messages, but did <strong>not<\/strong> reach the <strong>number<\/strong> of failed or deferred messages.<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">6<\/td>\n<td align=\"left\">2<\/td>\n<td align=\"left\">75%<\/td>\n<td align=\"left\">OK \u2014 The domain reached the <strong>percentage<\/strong> of failed or deferred messages, but did <strong>not<\/strong> reach the <strong>number<\/strong> of failed or deferred messages.<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">6<\/td>\n<td align=\"left\">3<\/td>\n<td align=\"left\">67%<\/td>\n<td align=\"left\">OK \u2014 The domain reached the <strong>percentage<\/strong> of failed or deferred messages, but did <strong>not<\/strong> reach the <strong>number<\/strong> of failed or deferred messages.<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">6<\/td>\n<td align=\"left\">4<\/td>\n<td align=\"left\">60%<\/td>\n<td align=\"left\">OK \u2014 The domain reached the <strong>percentage<\/strong> of failed or deferred messages, but did <strong>not<\/strong> reach the <strong>number<\/strong> of failed or deferred messages.<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">6<\/td>\n<td align=\"left\">5<\/td>\n<td align=\"left\">55%<\/td>\n<td align=\"left\">OK \u2014 The domain reached the <strong>percentage<\/strong> of failed or deferred messages, but did <strong>not<\/strong> reach the <strong>number<\/strong> of failed or deferred messages.<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">6<\/td>\n<td align=\"left\">6<\/td>\n<td align=\"left\">50%<\/td>\n<td align=\"left\">OK \u2014 The domain did <strong>not<\/strong> reach either condition.<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">6<\/td>\n<td align=\"left\">7<\/td>\n<td align=\"left\">46%<\/td>\n<td align=\"left\">OK \u2014 The domain did <strong>not<\/strong> reach either condition.<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">7<\/td>\n<td align=\"left\">7<\/td>\n<td align=\"left\">50%<\/td>\n<td align=\"left\">OK \u2014 The domain reached the <strong>number<\/strong> of failed or deferred messages, but did <strong>not<\/strong> reach the <strong>percentage<\/strong> of failed or deferred messages.<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">8<\/td>\n<td align=\"left\">7<\/td>\n<td align=\"left\">53%<\/td>\n<td align=\"left\">OK \u2014 The domain reached the <strong>number<\/strong> of failed or deferred messages, but did <strong>not<\/strong> reach the <strong>percentage<\/strong> of failed or deferred messages.<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">9<\/td>\n<td align=\"left\">7<\/td>\n<td align=\"left\">56%<\/td>\n<td align=\"left\"><strong>OUTGOING MAIL BLOCKED<\/strong> \u2014 The domain reached <strong>both<\/strong> conditions.<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/div>\n<\/p><\/div>\n<\/div>\n<h3 id=\"number-of-failed-or-deferred-messages-a-domain-may-send-before-protections-can-be-triggered\">Number of failed or deferred messages a domain may send before protections can be triggered<\/h3>\n<div class=\"callout callout-success\">\n<div class=\"callout-heading\">Remember:<\/div>\n<div class=\"callout-content\">\n<p>Use the <em>Number of failed or deferred messages a domain may send before protections can be triggered<\/em> option with the <em>Maximum percentage of failed or deferred messages a domain may send per hour<\/em> option. Your server does <strong>not<\/strong> temporarily block outgoing mail from a domain until the domain reaches <strong>both<\/strong> limits.<\/p>\n<\/p><\/div>\n<\/div>\n<p>This option defines how many failed or deferred messages that a domain can send before the mail server checks whether the <em>Maximum percentage of failed or deferred messages a domain may send per hour<\/em> value was met.<\/p>\n<h4 id=\"attributes-3\">Attributes<\/h4>\n<ul>\n<li>\n<p><code>cpanel.config<\/code> entry: <code>email_send_limits_min_defer_fail_to_trigger_protection<\/code><\/p>\n<\/li>\n<li>\n<p>Default value: <code>5<\/code><\/p>\n<\/li>\n<li>\n<p>Minimum value: <code>1<\/code><\/p>\n<\/li>\n<li>\n<p>Maximum value:    <code>1000000000000000000<\/code><\/p>\n<\/li>\n<li>\n<p>Permissions: A user with <code>root<\/code> permissions can access this option.<\/p>\n<\/li>\n<\/ul>\n<h3 id=\"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<\/h3>\n<div class=\"callout callout-success\">\n<div class=\"callout-heading\">Remember:<\/div>\n<div class=\"callout-content\">\n<p>Use the <em>Maximum percentage of failed or deferred messages a domain may send per hour<\/em> option with the <em>Number of failed or deferred messages a domain may send before protections can be triggered<\/em> option. Your server does <strong>not<\/strong> temporarily block outgoing mail from a domain until the domain reaches <strong>both<\/strong> limits.<\/p>\n<\/p><\/div>\n<\/div>\n<p>This option specifies the maximum percentage of failed or deferred messages that a domain may send per hour. This option <strong>only<\/strong> applies after the number of failed or deferred messages reaches the <em>Number of failed or deferred messages a domain may send before protections can be triggered<\/em> option\u2019s value.<\/p>\n<h4 id=\"attributes-4\">Attributes<\/h4>\n<ul>\n<li>\n<p><code>cpanel.config<\/code> entry: <code>email_send_limits_max_defer_fail_percentage<\/code><\/p>\n<\/li>\n<li>\n<p>Default value: <code>Unlimited<\/code><\/p>\n<\/li>\n<li>\n<p>Minimum value: <code>1<\/code><\/p>\n<\/li>\n<li>\n<p>Maximum value:    <code>Unlimited<\/code><\/p>\n<\/li>\n<li>\n<p>Permissions: A user with <code>root<\/code> permissions can access this option.<\/p>\n<\/li>\n<\/ul>\n<h3 id=\"error-message\">Error message<\/h3>\n<p>If a domain reaches the limits set in the <em>Maximum percentage of failed or deferred messages a domain may send per hour<\/em> and <em>Number of failed or deferred messages a domain may send before protections can be triggered<\/em> options set, then your error log will contain entries that resemble the following example:\n<\/p>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\">R<span style=\"color:#f92672\">=<\/span>enforce_mail_permissions: Domain example.com has exceeded the max defers and failures per hour <span style=\"color:#f92672\">(<\/span><span style=\"color:#ae81ff\">7<\/span>\/5 <span style=\"color:#f92672\">(<\/span><span style=\"color:#ae81ff\">20<\/span>%<span style=\"color:#f92672\">))<\/span> allowed. Message discarded.<\/code><\/pre>\n<\/div>\n<p>The number of failed and deferred outgoing messages affect the values in the error message in the following ways:<\/p>\n<ul>\n<li>\n<p><code>7<\/code>   \u2014 The number of failed or deferred outgoing messages from the domain in the hour.<\/p>\n<\/li>\n<li>\n<p><code>5<\/code>   \u2014 The number of failed or deferred messages the mail server allows the domain to send in an hour, before it checks the percentage of failed or deferred outgoing messages that the mail server allows the domain to send. To set this value, use the <em>Number of failed or deferred messages a domain may send before protections can be triggered<\/em> option.<\/p>\n<\/li>\n<li>\n<p><code>20<\/code>  \u2014 The current percentage of deferred or failed outgoing messages for the domain. This percentage is based on the total messages sent compared to the number of failed or deferred outgoing messages per hour for the domain.<\/p>\n<\/li>\n<\/ul><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Overview The Mail section of WHM\u2019s Tweak Settings interface (WHM &gt;&gt; Home &gt;&gt; Server Configuration &gt;&gt; Tweak Settings) contains five options that allow you to limit outgoing mail. The limits that these options set apply to all domains on the server. Use the options to help limit bandwidth consumption and prevent potential spammers. Important: You &hellip;<\/p>\n","protected":false},"author":1,"featured_media":461,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts\/460"}],"collection":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/comments?post=460"}],"version-history":[{"count":0,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts\/460\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/media\/461"}],"wp:attachment":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/media?parent=460"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/categories?post=460"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/tags?post=460"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}