0
|
1 <html>
|
|
2
|
|
3 <head>
|
|
4 <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
|
|
5 <title>DNSBL Sendmail milter</title>
|
|
6 </head>
|
|
7
|
|
8 <p>This milter is released under the GPL license version 2 included in
|
|
9 the LICENSE file in the distribution, and also available at
|
|
10 <a href="http://www.gnu.org/licenses/gpl.html">http://www.gnu.org/licenses/gpl.html</a>
|
|
11
|
|
12 <p>Consider the case of a mail server that is acting as secondary MX
|
|
13 for a collection of clients, each of which has a collection of mail
|
|
14 domains. Each client may use their own collection of DNSBLs on their
|
|
15 primary mail server. We present here a mechanism whereby the backup
|
|
16 mail server can use the correct set of DNSBLs for each message. As a
|
|
17 side-effect, it gives us the ability to customize the set of DNSBLs on a
|
|
18 per-recipient basis, so that fred@example.com could use SPEWS and the
|
|
19 SBL, where all other users @example.com use only the SBL.
|
|
20
|
|
21 <p>The DNSBL milter reads a text configuration file on startup, and
|
|
22 whenever the config file (or any of the referenced include files) is
|
|
23 changed. The entire configuration file is case insensitive.
|
|
24
|
|
25 <p>If you are also using the <a
|
|
26 href="http://www.rhyolite.com/anti-spam/dcc/">DCC</a> milter, there are
|
|
27 a few considerations. You may need to whitelist senders from the DCC
|
|
28 bulk detector, or from the DNS based lists. Those are two very
|
|
29 different reasons for whitelisting. The former is done thru the DCC
|
|
30 whiteclnt config file, the later is done thru the DNSBL milter config
|
5
|
31 file.
|
0
|
32
|
|
33 <p>You may want to blacklist some specific senders or sending domains.
|
|
34 This could be done thru either the DCC (on a global basis, or for a
|
|
35 specific single recipient). We prefer to do such blacklisting via the
|
|
36 DNSBL milter config, since it can be done for an entire recipient mail
|
|
37 domain. The DCC approach has the feature that you can capture the
|
|
38 entire message in the DCC log files. The DNSBL milter approach has the
|
|
39 feature that the mail is rejected earlier (at RCPT TO time), and the
|
|
40 sending machine just gets a generic "550 5.7.1 no such user" message.
|
|
41
|
5
|
42 <p>There is an option to reference the DCC whiteclnt file (via an
|
|
43 include_dcc line) in the DNSBL milter config. This will import the
|
|
44 (env_to, env_from, and substitute mail_host) entries from the DCC config
|
|
45 into the DNSBL config. This allows using the DCC config as the single
|
|
46 point for white/blacklisting.
|
|
47
|
|
48 <p>Consider the case where you have multiple clients, each with their
|
|
49 own mail servers, and each running their own DCC milters. Each client
|
|
50 is using the DCC facilities for envelope from/to white/blacklisting.
|
|
51 Presumably you can use rsync or scp to fetch copies of these clients DCC
|
|
52 whiteclnt files on a regular basis. Your mail server, acting as a
|
|
53 backup MX for your clients, can use the DNSBL milter, and include those
|
|
54 client DCC config files. The envelope to white/blacklisting will be
|
|
55 global for your system, but the envelope from white/blacklisting will be
|
|
56 appropriately tagged and used only for the domains controlled by each of
|
|
57 those clients.
|
|
58
|
0
|
59 <p>Definitions:
|
|
60
|
|
61 <p>DNSBL - a named DNS based blocking list is defined by a dns suffix
|
|
62 (e.g. sbl-xbl.spamhaus.org) and a message string that is used to
|
|
63 generate the "550 5.7.1" smtp error return code. The names of these
|
|
64 DNSBLs will be used to define the DNSBL-LISTs.
|
|
65
|
|
66 <p>DNSBL-LIST - a named list of DNSBLs that will be used for specific
|
|
67 recipients or recipient domains.
|
|
68
|
|
69 <p>ENVELOPE-FROM-MAP - a named collection of mappings (key->value pairs)
|
|
70 from envelope-from values to the WHITE, BLACK, or DEFAULT keywords. The
|
|
71 names of these maps will be used for specific recipients or recipient
|
|
72 domains.
|
|
73
|
|
74 <p>The configuration file maps each recipient (or recipient domain) to
|
|
75 two names (a named DNSBL-LIST, and a named ENVELOPE-FROM-MAP). If the
|
|
76 recipient is not found in the configuration, the named DEFAULT
|
|
77 dnsbl-list and DEFAULT envelope-from-map will be used. When mail is
|
|
78 received for that recipient,
|
|
79
|
|
80 <ol>
|
|
81
|
|
82 <li>If the client has authenticated with sendmail, the mail is accepted
|
|
83 and the dns lists are not checked.
|
|
84
|
|
85 <li>If either one is BLACK, mail to this recipient is rejected with "no
|
|
86 such user", and the dns lists are not checked.
|
|
87
|
|
88 <li>If the envelope-from-map name is WHITE, mail to this recipient is
|
|
89 accepted and the dns lists are not checked.
|
|
90
|
|
91 <li>If the envelope-from-map exists, the map is checked for the presence
|
|
92 of the sender. A WHITE or BLACK answer is definitive and the dns lists
|
|
93 are not checked.
|
|
94
|
|
95 <li>If the dnsbl-list name is WHITE, the dns lists are not checked and
|
|
96 the mail is accepted. Otherwise, the dns lists are checked and the mail
|
|
97 is rejected if any list has an A record for the standard dns based
|
|
98 lookup scheme (reversed octets of the client followed by the dns
|
|
99 suffix).
|
|
100
|
|
101 </ol>
|
|
102
|
|
103
|
|
104 <p>Usage: Note that this has ONLY been tested on Linux, specifically
|
|
105 RedHat Linux. Your mileage will vary. In particular, this milter makes no
|
|
106 attempt to understand IPv6.
|
|
107
|
|
108 Fetch <a href="http://www.five-ten-sg.com/util/dnsbl.tar.gz">dnsbl.tar.gz</a>
|
|
109 and
|
|
110
|
|
111 <pre>
|
|
112 tar xfvz dnsbl.tar.gz
|
|
113 bash install.bash
|
|
114 </pre>
|
|
115
|
|
116 Read and understand the contents of that install.bash script before you
|
|
117 run it. It may not be suitable for your system. Modify your
|
|
118 sendmail.mc by removing all the "FEATURE(dnsbl" lines, add the following
|
|
119 line in your sendmail.mc and rebuild the .cf file
|
|
120
|
|
121 <pre>
|
|
122 INPUT_MAIL_FILTER(`dnsbl', `S=local:/var/run/dnsbl/dnsbl.sock, F=T, T=S:30s;R:30s;E:30s')
|
|
123 </pre>
|
|
124
|
|
125 Read the sample <a
|
|
126 href="http://www.five-ten-sg.com/dnsbl.conf">var/dnsbl/dnsbl.conf</a>
|
|
127 file and modify it to fit your configuration.
|
|
128
|
|
129
|
4
|
130 <pre>
|
2
|
131 $Id$
|
4
|
132 </pre>
|
0
|
133 </body>
|
|
134 </html>
|