<?xml version="1.0"?>
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><title>ratefilter</title><link rel="stylesheet" type="text/css" href="style.css"/><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"/><link rel="home" href="#idm255217014336" title="ratefilter"/><link xmlns="" rel="stylesheet" type="text/css" href="manpage.css"/><meta xmlns="" name="MSSmartTagsPreventParsing" content="TRUE"/><link xmlns="" rel="icon" href="icon.gif" type="image/gif"/><!--

Copyright 1998 - 2009 Double Precision, Inc.  See COPYING for distribution
information.

--></head><body><div class="refentry"><a id="idm255217014336" shape="rect"> </a><div class="titlepage"/><div class="refnamediv"><h2>Name</h2><p>ratefilter — Rate-limiting mail filter</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">filterctl</code>  {[start] |  [stop]}  ratefilter </p></div></div><div class="refsect1"><a id="idm255221521200" shape="rect"> </a><h2>DESCRIPTION</h2><p>
      Enable this filter to enforce a maximum number of messages accepted
      from the same sender.
    </p><p>
      <span class="command"><strong>ratefilter</strong></span> uses the following configuration files.
      Changes to
      the following files do not take effect until the filter has been stopped
      and restarted.
    </p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="filename">@sysconfdir@/filters/ratefilter-interval</code></span></dt><dd><p>
	    This file contains a single numerical value that sets the
	    rate limiting time interval setting, in seconds.
	    The default value is sixty seconds. Sixty seconds is also the
	    minimum acceptable interval.
	  </p></dd><dt><span class="term"><code class="filename">@sysconfdir@/filters/ratefilter-maxrcpts</code></span></dt><dd><p>
	    This file contains a single numerical value that sets how many
	    receipients the same sender can send mail to, within the
	    controlling time interval. The default value is 100 recipients.
	  </p></dd><dt><span class="term"><code class="filename">@sysconfdir@/filters/ratefilter-minuid</code></span></dt><dd><p>
	    When <span class="command"><strong>ratefilter</strong></span> is enabled for locally
	    originating mail, this sets the minimum system userid that has
	    rate limiting enforced. The default value is 100. Mail sent by
	    processes with lower uids are not subject to rate limiting.
	  </p></dd><dt><span class="term"><code class="filename">@sysconfdir@/filters/ratefilter-mode</code></span></dt><dd><p>
	    If this file exists and contains the word "all",
	    <span class="command"><strong>ratefilter</strong></span> creates its listening
	    socket in <code class="filename">@localstatedir@/allfilters</code>,
	    otherwise the socket gets
	    created in <code class="filename">@localstatedir@/filters</code>, see
	    <a class="ulink" href="courierfilter.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">courierfilter</span>(8)</span></a>
	    for more information.</p></dd></dl></div><p>
      The <code class="filename">enablefiltering</code> settings controls whether local
      or <code class="literal">ESMTP</code> mail is subject to rate limiting, see 
      <a class="ulink" href="courier.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">courier</span>(8)</span></a>
      for more information.
    </p><p>
      In this context, <span class="quote">“<span class="quote">local</span>”</span> mail refers to mail that gets sent
      when a process executes the
      <a class="ulink" href="sendmail.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">sendmail</span>(1)</span></a>
      command. This does not include mail sent via connection to local port
      25, this is considered <code class="literal">ESMTP</code> mail.
    </p><p>
      Local mail gets rate limited based on the sending process's userid.
      Each numerical userid gets treated as an individual sender.
      <code class="literal">ESMTP</code> mail's sender is taken from the authenticated
      <code class="literal">ESMTP</code>'s userid. Non-authenticated
      <code class="literal">ESMTP</code> mail is not subject to rate limiting.
    </p><p>
      Rate limiting is implemented by dividing chronological time into
      intervals that are half the time interval given in the
      <code class="filename">ratefilter-interval</code> setting. For example, with
      the default interval of sixty seconds, chronological time
      gets divided into thirty second intervals.
    </p><p>
      <span class="command"><strong>ratefilter</strong></span> counts
      the number of receipients in each message (and not just
      the number of messages) from each sender, in each time interval.
    </p><p>
      <span class="command"><strong>ratefilter</strong></span> rejects the message when
      the total number of recipients from all messages from the same
      sender in the current and the previous time interval exceeds the
      <code class="filename">ratefilter-maxrcpts</code> setting. The rejected message's
      number of recipients also get counted, for the purpose of rejecting
      future messages.
    </p></div><div class="refsect1"><a id="idm255216161472" shape="rect"> </a><h2>SEE ALSO</h2><p>
<a class="ulink" href="courierfilter.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">courierfilter</span>(8)</span></a>.</p></div></div></body></html>
