Exim 4.72 release
[exim-website.git] / howto / rbl.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3   <head>
4     <title>HOWTO - Using DNS Block Lists (DNSBLs)</title>
5   </head>
6
7   <body bgcolor="#FFFFFF" text="#00005A" link="#FF6600" alink="#FF9933" vlink="#990000">
8     <h1>HOWTO - Using DNS Block Lists (DNSBLs)</h1>
9
10     <p>The MAPS (Mail Abuse Protection System) RBL (Realtime Blackhole
11     List) was the first application of a way of using a DNS list as a
12     means of identifying hosts that have been associated with the
13     sending of spam mail.  A full description of the service and the
14     technology and ethics behind it can be found at <a
15     href="http://www.mail-abuse.org/rbl/"><tt>http://www.mail-abuse.org/rbl/</tt></a>
16     along with more general mail policy information at <a
17     href="http://www.mail-abuse.org/"><tt>http://www.mail-abuse.org/</tt></a>.</p>
18
19     <p>In the few years since MAPS started operating, other similar
20     services although with different aims, procedures and
21     reliabilities have been introduced - MAPS itself has a number of
22     these (ie MAPS/DUL which maintains lists of dial up modems).  At
23     this point in time there are many 10s of services with varying
24     charters - lists of these can be found at <a
25     href="http://relays.osirusoft.com/"><tt>http://relays.osirusoft.com/</tt></a>
26     and <a
27     href="http://spamblock.outblaze.com/spamchk.html"><tt>http://spamblock.outblaze.com/spamchk.html</tt></a>.
28     The services are now normally referred to as a DNS Block List
29     (DNSBL), rather than RBLs, however you will find that earlier Exim
30     documentation (ie for version 3.x) will use the older term.</p>
31
32     <h2>Exim DNSBL Support</h2>
33
34     <p>Exim has supported RBL from version 1.80, although the
35     flexibility was increased (with a related change configuration
36     options) on the release of Exim 3.00.  With the release of Exim
37       4.00 the whole basis of policy checks on incoming mail changed
38       to be based on a set of Access Control Lists (ACLs) applied at
39       various during the incoming mail transaction.  For this reason
40       the configuration of Exim 4.x and later to use DNSBLs is
41       complete different to that used for earlier versions.</p>
42
43     <h2>Exim 4.x DNSBL Usage</h2>
44
45     <p>In Exim 4.x a DNSBL lookup can be used in any of the incoming SMTP
46     ACLs.  However it is typical for the lookups to be used in the ACL
47       handling <tt>RCPT TO</tt> - this allows policies to accept mail
48       for <tt>postmaster</tt> or other special local parts (for
49       example so a blocked sender can talk to the local postmaster
50       about getting blocks lifted or excluded)</p>
51
52     <p>The use of DNSBLs is substantially documented in the main exim
53       specification or the 4.x versions, so will not be covered in
54       detail here.  However a couple of examples can be given</p>
55     <pre>
56   # Add a warning header if the sending host is in these
57   # DNSBLs but acccept the message (or rather leave it for
58   # later ACLs to accept/deny
59   warn message = X-blacklisted-at: $dnslist_domain
60        dnslists = blackholes.mail-abuse.org : \
61                   dialup.mail-abuse.org
62
63
64
65   # Reject messages from senders listed in these DNSBLs
66   deny dnslists = blackholes.mail-abuse.org
67     </pre>
68
69     <p>Documentation on these features can be found in the
70       specification section on
71       <a href="../exim-html-4.20/doc/html/spec_37.html">
72       Access Control Lists</a>.</p>
73
74     <h2>Exim 3.x DNSBL Usage</h2>
75
76     <p>The exim RBL support allows one or more RBL systems to be
77     checked and messages from hosts within each RBL to be either
78     rejected or marked by the addition of an extra header
79     <tt>X-RBL-Warning:</tt>.  It is also possible to have a limited
80     number of recipients bypass the RBL reject functions completely,
81     thus allowing postmaster (for example) to receive mail even from
82     an RBL blocked site.</p>
83
84
85    <h3>RBL Configuration Options</h3>
86
87     <p>These are fully detailed in the <a
88     href="../exim-html-3.20/doc/html/spec.html" target="_top">Exim
89     Specification Document</a>. The specific section on RBL is <a
90     href="../exim-html-3.20/doc/html/spec_46.html#SEC810">here</a> and
91     the rbl directives are documented starting <a
92     href="../exim-html-3.20/doc/html/spec_11.html#SEC311">here</a></p>
93
94     <p>A typical configuration would be a mail system which rejects
95     mail from machines that appear within either the MAPS RBL list or
96     the MAPS DUL (Dial-Up List), and also checks hosts in the RSS
97     lists but only marking each message has coming via an RBLed host
98     rather than rejecting them.  Additionally all mail to the local
99     postmaster always gets through, even if the host is in the MAPS
100     RBL list.  You also have a local private set of IPs which relay
101     out through this mail server on net 192.168.0.0/24 - these cannot
102     be contacted from outside your organisation so RBL is not an
103     issue.</p>
104
105     <p>The configuration fragment (in the main part of the exim
106     configuration file) to do this is:-</p>
107
108     <pre>
109 # reject messages whose sending host is in MAPS/RBL & MAP/DUL
110 # add warning to messages whose sending host is in RSS
111 rbl_domains = blackholes.mail-abuse.org/reject : \
112         dialups.mail-abuse.org/reject : \
113         relays.mail-abuse.org/warn
114 # check all hosts other than those on internal network
115 rbl_hosts = !192.168.0.0/24:0.0.0.0/0
116 # but allow mail to postmaster@my.dom.ain even from rejected host
117 recipients_reject_except = postmaster@my.dom.ain
118 # change some logging actions (collect more data)
119 rbl_log_headers  # log headers of accepted RBLed messages
120 rbl_log_rcpt_count # log recipient info of accepted RBLed messages
121     </pre>
122
123     <p>The information to do more complicated manipulations can be
124       found in the specification document and is outside the scope of
125       this note.</p>
126     <hr>
127     <address><a href="mailto:Postmaster@exim.org">Nigel Metheringham</a></address>
128 <!-- Created: Mon Aug 25 15:46:41 BST 1997 -->
129     <h4>$Cambridge$</h4>
130   </body>
131 </html>