comparison xml/dnsbl.in @ 136:f4746d8a12a3

add smtp auth rate limits
author carl
date Tue, 26 Sep 2006 13:59:14 -0700
parents 2b1a4701e856
children 4028de9b46dd
comparison
equal deleted inserted replaced
135:8e813497582e 136:f4746d8a12a3
169 unless previously whitelisted. This milter also counts the number of 169 unless previously whitelisted. This milter also counts the number of
170 invalid HTML tags, and can reject mail if that count exceeds your 170 invalid HTML tags, and can reject mail if that count exceeds your
171 specified limit. 171 specified limit.
172 </para> 172 </para>
173 <para> 173 <para>
174 This milter can also impose hourly rate limits on the number of
175 recipients accepted from SMTP AUTH connections, that would otherwise be
176 allowed to relay thru this mail server with no spam filtering.
177 </para>
178 <para>
174 The DNSBL milter reads a text configuration file (dnsbl.conf) on 179 The DNSBL milter reads a text configuration file (dnsbl.conf) on
175 startup, and whenever the config file (or any of the referenced include 180 startup, and whenever the config file (or any of the referenced include
176 files) is changed. The entire configuration file is case insensitive. 181 files) is changed. The entire configuration file is case insensitive.
177 If the configuration cannot be loaded due to a syntax error, the milter 182 If the configuration cannot be loaded due to a syntax error, the milter
178 will log the error and quit. If the configuration cannot be reloaded 183 will log the error and quit. If the configuration cannot be reloaded
245 </refsect1> 250 </refsect1>
246 251
247 <refsect1 id='filtering.1'> 252 <refsect1 id='filtering.1'>
248 <title>Filtering Procedure</title> 253 <title>Filtering Procedure</title>
249 <para> 254 <para>
250 If the client has authenticated with sendmail, the mail is accepted, the 255 If the client has authenticated with sendmail, the rate limits are
251 filtering contexts are not used, the dns lists are not checked, and the 256 checked. If the authenticated user has not exceeded the hourly rate
252 body content is not scanned. Otherwise, we follow these steps for each 257 limits, then the mail is accepted, the filtering contexts are not used,
253 recipient. 258 the dns lists are not checked, and the body content is not scanned. If
259 the client has not authenticated with sendmail, we follow these steps
260 for each recipient.
254 </para> 261 </para>
255 <orderedlist> 262 <orderedlist>
256 <listitem><para> 263 <listitem><para>
257 The envelope to email address is used to find an initial filtering 264 The envelope to email address is used to find an initial filtering
258 context. We first look for a context that specified the full email 265 context. We first look for a context that specified the full email
447 <title>TODO</title> 454 <title>TODO</title>
448 <para> 455 <para>
449 The following ideas are under consideration. 456 The following ideas are under consideration.
450 </para> 457 </para>
451 <para> 458 <para>
452 Add mail volume limits based on smtp auth accounts, to prevent
453 customers from sending too much mail. This should catch customers
454 that get infected with malware that knows about smtp auth.
455 </para>
456 <para>
457 Add a per-context option to reject mail if the number of digits in 459 Add a per-context option to reject mail if the number of digits in
458 the reverse dns client name exceeds some threshold. 460 the reverse dns client name exceeds some threshold.
459 </para> 461 </para>
460 <para> 462 <para>
461 Look for href="hostname/path" strings that are missing the required 463 Look for href="hostname/path" strings that are missing the required
521 523
522 <literallayout class="monospaced"><![CDATA[ 524 <literallayout class="monospaced"><![CDATA[
523 CONFIG = {CONTEXT ";"}+ 525 CONFIG = {CONTEXT ";"}+
524 CONTEXT = "context" NAME "{" {STATEMENT}+ "}" 526 CONTEXT = "context" NAME "{" {STATEMENT}+ "}"
525 STATEMENT = (DNSBL | DNSBLLIST | CONTENT | ENV-TO | VERIFY | 527 STATEMENT = (DNSBL | DNSBLLIST | CONTENT | ENV-TO | VERIFY |
526 CONTEXT | ENV-FROM) ";" 528 CONTEXT | ENV-FROM | RATE-LIMIT) ";"
527 529
528 DNSBL = "dnsbl" NAME DNSPREFIX ERROR-MSG1 530 DNSBL = "dnsbl" NAME DNSPREFIX ERROR-MSG1
529 531
530 DNSBLLIST = "dnsbl_list" {NAME}+ 532 DNSBLLIST = "dnsbl_list" {NAME}+
531 533
558 VERIFY = "verify" HOSTNAME ";" 560 VERIFY = "verify" HOSTNAME ";"
559 561
560 ENV_FROM = "env_from" [DEFAULT] "{" {(FROM-ADDR | DCC-FROM)}+ "}" 562 ENV_FROM = "env_from" [DEFAULT] "{" {(FROM-ADDR | DCC-FROM)}+ "}"
561 FROM-ADDR = ADDRESS VALUE [";"] 563 FROM-ADDR = ADDRESS VALUE [";"]
562 DCC-FROM = "dcc_from" "{" DCCINCLUDEFILE "}" ";" 564 DCC-FROM = "dcc_from" "{" DCCINCLUDEFILE "}" ";"
565
566 RATE-LIMIT = "rate_limit" "{" (RATE)+ "}"
567 RATE = USER LIMIT [";"]
568
563 DEFAULT = ("white" | "black" | "unknown" | "inherit" | "") 569 DEFAULT = ("white" | "black" | "unknown" | "inherit" | "")
564 ADDRESS = (USER@ | DOMAIN | USER@DOMAIN) 570 ADDRESS = (USER@ | DOMAIN | USER@DOMAIN)
565 VALUE = ("white" | "black" | "unknown" | CHILD-CONTEXT-NAME)]]></literallayout> 571 VALUE = ("white" | "black" | "unknown" | CHILD-CONTEXT-NAME)]]></literallayout>
566 </refsect1> 572 </refsect1>
567 573
593 // backscatter prevention - don't send bounces for mail that we accepted but could not forward 599 // backscatter prevention - don't send bounces for mail that we accepted but could not forward
594 // we only send bounces to our own customers 600 // we only send bounces to our own customers
595 env_from unknown { 601 env_from unknown {
596 "<>" black; 602 "<>" black;
597 }; 603 };
604
605 // per recipient rates - only available in the default (first top level) context
606 rate_limit {
607 " " 30; // default specified by user name composed of a single blank
608 fred 100; // override default limits
609 joe 10;
610 };
598 }; 611 };
599 612
600 context sample { 613 context sample {
601 dnsbl local blackholes.five-ten-sg.com "Mail from %s rejected - local; see http://www.five-ten-sg.com/blackhole.php?%s"; 614 dnsbl local blackholes.five-ten-sg.com "Mail from %s rejected - local; see http://www.five-ten-sg.com/blackhole.php?%s";
602 dnsbl sbl sbl-xbl.spamhaus.org "Mail from %s rejected - sbl; see http://www.spamhaus.org/query/bl?ip=%s"; 615 dnsbl sbl sbl-xbl.spamhaus.org "Mail from %s rejected - sbl; see http://www.spamhaus.org/query/bl?ip=%s";