Mercurial > dnsbl
annotate xml/dnsbl.in @ 56:57607387263d stable-3-6
updates for 3.6, better documentation on removing content filtering, missing some files in cvs
author | carl |
---|---|
date | Wed, 08 Sep 2004 14:46:45 -0700 |
parents | c2371bb6cf84 |
children | 419e00901570 |
rev | line source |
---|---|
0 | 1 <html> |
2 | |
3 <head> | |
4 <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> | |
56
57607387263d
updates for 3.6, better documentation on removing content filtering, missing some files in cvs
carl
parents:
53
diff
changeset
|
5 <title>DNSBL Sendmail milter - Version 3.6</title> |
0 | 6 </head> |
7 | |
12 | 8 <center>Introduction</center> |
0 | 9 <p>This milter is released under the GPL license version 2 included in |
10 the LICENSE file in the distribution, and also available at | |
11 <a href="http://www.gnu.org/licenses/gpl.html">http://www.gnu.org/licenses/gpl.html</a> | |
12 | |
12 | 13 <p>Consider the case of a mail server that is acting as secondary MX for |
14 a collection of clients, each of which has a collection of mail domains. | |
15 Each client may use their own collection of DNSBLs on their primary mail | |
16 server. We present here a mechanism whereby the backup mail server can | |
17 use the correct set of DNSBLs for each recipient for each message. As a | |
0 | 18 side-effect, it gives us the ability to customize the set of DNSBLs on a |
19 per-recipient basis, so that fred@example.com could use SPEWS and the | |
20 SBL, where all other users @example.com use only the SBL. | |
21 | |
27
43a4f6b3e668
add configurable host name limit and bad html tag limits.
carl
parents:
24
diff
changeset
|
22 <p>This milter will also decode (base64, mime, html entity, url |
43a4f6b3e668
add configurable host name limit and bad html tag limits.
carl
parents:
24
diff
changeset
|
23 encodings) and scan for HTTP and HTTPS URLs and bare hostnames in the |
34 | 24 body of the mail. If any of those host names have A or NS records on |
25 the SBL (or a single configurable DNSBL), the mail will be rejected | |
26 unless previously whitelisted. This milter also counts the number of | |
27 invalid HTML tags, and can reject mail if that count exceeds your | |
28 specified limit. | |
11 | 29 |
6 | 30 <p>The DNSBL milter reads a text configuration file (dnsbl.conf) on |
31 startup, and whenever the config file (or any of the referenced include | |
32 files) is changed. The entire configuration file is case insensitive. | |
0 | 33 |
12 | 34 <hr> |
35 <center>DCC Issues</center> | |
0 | 36 <p>If you are also using the <a |
37 href="http://www.rhyolite.com/anti-spam/dcc/">DCC</a> milter, there are | |
38 a few considerations. You may need to whitelist senders from the DCC | |
39 bulk detector, or from the DNS based lists. Those are two very | |
40 different reasons for whitelisting. The former is done thru the DCC | |
41 whiteclnt config file, the later is done thru the DNSBL milter config | |
5 | 42 file. |
0 | 43 |
44 <p>You may want to blacklist some specific senders or sending domains. | |
45 This could be done thru either the DCC (on a global basis, or for a | |
46 specific single recipient). We prefer to do such blacklisting via the | |
13 | 47 DNSBL milter config, since it can be done for a collection of recipient |
48 mail domains. The DCC approach has the feature that you can capture the | |
0 | 49 entire message in the DCC log files. The DNSBL milter approach has the |
50 feature that the mail is rejected earlier (at RCPT TO time), and the | |
51 sending machine just gets a generic "550 5.7.1 no such user" message. | |
52 | |
5 | 53 <p>There is an option to reference the DCC whiteclnt file (via an |
54 include_dcc line) in the DNSBL milter config. This will import the | |
55 (env_to, env_from, and substitute mail_host) entries from the DCC config | |
56 into the DNSBL config. This allows using the DCC config as the single | |
13 | 57 point for white/blacklisting. When used in this manner, the whitelist |
58 env_to entries from the DCC config become global whitelist entries in | |
59 the DNSBL config. | |
5 | 60 |
61 <p>Consider the case where you have multiple clients, each with their | |
62 own mail servers, and each running their own DCC milters. Each client | |
63 is using the DCC facilities for envelope from/to white/blacklisting. | |
6 | 64 Presumably you can use rsync or scp to fetch copies of your clients DCC |
5 | 65 whiteclnt files on a regular basis. Your mail server, acting as a |
66 backup MX for your clients, can use the DNSBL milter, and include those | |
67 client DCC config files. The envelope to white/blacklisting will be | |
68 global for your system, but the envelope from white/blacklisting will be | |
69 appropriately tagged and used only for the domains controlled by each of | |
70 those clients. | |
71 | |
12 | 72 <hr> |
73 <center>Definitions</center> | |
0 | 74 <p>DNSBL - a named DNS based blocking list is defined by a dns suffix |
75 (e.g. sbl-xbl.spamhaus.org) and a message string that is used to | |
76 generate the "550 5.7.1" smtp error return code. The names of these | |
77 DNSBLs will be used to define the DNSBL-LISTs. | |
78 | |
79 <p>DNSBL-LIST - a named list of DNSBLs that will be used for specific | |
80 recipients or recipient domains. | |
81 | |
82 <p>ENVELOPE-FROM-MAP - a named collection of mappings (key->value pairs) | |
83 from envelope-from values to the WHITE, BLACK, or DEFAULT keywords. The | |
84 names of these maps will be used for specific recipients or recipient | |
85 domains. | |
86 | |
87 <p>The configuration file maps each recipient (or recipient domain) to | |
88 two names (a named DNSBL-LIST, and a named ENVELOPE-FROM-MAP). If the | |
89 recipient is not found in the configuration, the named DEFAULT | |
90 dnsbl-list and DEFAULT envelope-from-map will be used. When mail is | |
91 received for that recipient, | |
92 | |
93 <ol> | |
94 | |
95 <li>If the client has authenticated with sendmail, the mail is accepted | |
96 and the dns lists are not checked. | |
97 | |
98 <li>If either one is BLACK, mail to this recipient is rejected with "no | |
99 such user", and the dns lists are not checked. | |
100 | |
101 <li>If the envelope-from-map name is WHITE, mail to this recipient is | |
102 accepted and the dns lists are not checked. | |
103 | |
104 <li>If the envelope-from-map exists, the map is checked for the presence | |
105 of the sender. A WHITE or BLACK answer is definitive and the dns lists | |
106 are not checked. | |
107 | |
108 <li>If the dnsbl-list name is WHITE, the dns lists are not checked and | |
109 the mail is accepted. Otherwise, the dns lists are checked and the mail | |
110 is rejected if any list has an A record for the standard dns based | |
111 lookup scheme (reversed octets of the client followed by the dns | |
112 suffix). | |
113 | |
11 | 114 <li>If the mail has not been accepted or rejected yet, the body content |
56
57607387263d
updates for 3.6, better documentation on removing content filtering, missing some files in cvs
carl
parents:
53
diff
changeset
|
115 is optionally scanned for HTTP URLs (after base64, mime and html entity |
57607387263d
updates for 3.6, better documentation on removing content filtering, missing some files in cvs
carl
parents:
53
diff
changeset
|
116 decoding), and the first <configurable> host names are checked for |
57607387263d
updates for 3.6, better documentation on removing content filtering, missing some files in cvs
carl
parents:
53
diff
changeset
|
117 their presence on the SBL. If any host name is on the SBL, the mail is |
57607387263d
updates for 3.6, better documentation on removing content filtering, missing some files in cvs
carl
parents:
53
diff
changeset
|
118 rejected. If we are doing body content scanning, we also scan for |
57607387263d
updates for 3.6, better documentation on removing content filtering, missing some files in cvs
carl
parents:
53
diff
changeset
|
119 excessive bad html tags, and if a <configurable> limit is |
57607387263d
updates for 3.6, better documentation on removing content filtering, missing some files in cvs
carl
parents:
53
diff
changeset
|
120 exceeded, the mail is rejected. |
11 | 121 |
0 | 122 </ol> |
123 | |
12 | 124 <hr> |
125 <center>Sendmail access vs. DNSBL</center> | |
126 <p>With the standard sendmail.mc dnsbl FEATURE, the dnsbl checks may be | |
127 suppressed by entries in the /etc/mail/access database. For example, | |
128 suppose you control a /18 of address space, and have allocated some /24s | |
129 to some clients. You have access entries like | |
0 | 130 |
12 | 131 <pre> |
132 192.168.4 OK | |
133 192.168.17 OK | |
134 </pre> | |
135 | |
136 <p>to allow those clients to smarthost thru your mail server. Now if | |
13 | 137 one of those clients happens get infected with a virus that turns a |
138 machine into an open proxy, and their 192.168.4.45 lands on the SBL-XBL, | |
139 you will still wind up allowing that infected machine to smarthost thru | |
140 your mail servers. | |
12 | 141 |
142 <p>With this DNSBL milter, the sendmail access database cannot override | |
143 the dnsbl checks, so that machine won't be able to send mail to or thru | |
15 | 144 your smarthost mail server (unless the virus/proxy can use smtp-auth). |
145 | |
146 <p>Using the standard sendmail features, you would add access entries to | |
147 allow hosts on your local network to relay thru your mail server. Those | |
148 OK entries in the sendmail access database will override all the dnsbl | |
149 checks. With this DNSBL milter, you will need to have the local users | |
150 authenticate with smtp-auth to get the same effect. You might find <a | |
151 href="http://www.ists.dartmouth.edu/IRIA/knowledge_base/linuxinfo/sendmail-ssh-how-to.htm"> | |
152 these directions</a> helpful for setting up smtp-auth if you are on RH | |
153 Linux. | |
12 | 154 |
13 | 155 <hr> <center>Installation and configuration</center> <p>Usage: Note |
156 that this has ONLY been tested on Linux, specifically RedHat Linux. In | |
157 particular, this milter makes no attempt to understand IPv6. Your | |
158 mileage will vary. You will need at a minimum a C++ compiler with a | |
159 minimally thread safe STL implementation. The distribution includes a | |
160 test.cpp program. If it fails this milter won't work. If it passes, | |
161 this milter might work. | |
0 | 162 |
163 Fetch <a href="http://www.five-ten-sg.com/util/dnsbl.tar.gz">dnsbl.tar.gz</a> | |
164 and | |
165 | |
166 <pre> | |
167 tar xfvz dnsbl.tar.gz | |
168 bash install.bash | |
169 </pre> | |
170 | |
171 Read and understand the contents of that install.bash script before you | |
172 run it. It may not be suitable for your system. Modify your | |
173 sendmail.mc by removing all the "FEATURE(dnsbl" lines, add the following | |
174 line in your sendmail.mc and rebuild the .cf file | |
175 | |
176 <pre> | |
50 | 177 INPUT_MAIL_FILTER(`dnsbl', `S=local:/var/run/dnsbl/dnsbl.sock, F=T, T=C:30s;S:5m;R:5m;E:5m') |
0 | 178 </pre> |
179 | |
180 Read the sample <a | |
44 | 181 href="http://www.five-ten-sg.com/dnsbl.conf">/etc/dnsbl/dnsbl.conf</a> |
6 | 182 file and modify it to fit your configuration. You can test your |
13 | 183 configuration files, and see a readable internal dump of them on stdout |
6 | 184 with |
185 | |
186 <pre> | |
44 | 187 cd /etc/dnsbl |
188 /usr/sbin/dnsbl -c | |
6 | 189 </pre> |
190 | |
191 <pre> | |
0 | 192 |
193 | |
6 | 194 |
2 | 195 $Id$ |
4 | 196 </pre> |
0 | 197 </body> |
198 </html> |