Mercurial > dnsbl
annotate xml/dnsbl.in @ 258:7a16904fec66
Added tag stable-6-0-31 for changeset d11b529ce9c5
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Sun, 01 Jul 2012 10:34:43 -0700 |
parents | d6d5c50b9278 |
children | be939802c64e |
rev | line source |
---|---|
108 | 1 <reference> |
2 <title>@PACKAGE@ Sendmail milter - Version @VERSION@</title> | |
3 <partintro> | |
4 <title>Packages</title> | |
201
752d4315675c
add reference to mercurial repository in the documentation
Carl Byington <carl@five-ten-sg.com>
parents:
187
diff
changeset
|
5 |
108 | 6 <para>The various source and binary packages are available at <ulink |
201
752d4315675c
add reference to mercurial repository in the documentation
Carl Byington <carl@five-ten-sg.com>
parents:
187
diff
changeset
|
7 url="http://www.five-ten-sg.com/@PACKAGE@/packages/">http://www.five-ten-sg.com/@PACKAGE@/packages/</ulink>. |
108 | 8 The most recent documentation is available at <ulink |
201
752d4315675c
add reference to mercurial repository in the documentation
Carl Byington <carl@five-ten-sg.com>
parents:
187
diff
changeset
|
9 url="http://www.five-ten-sg.com/@PACKAGE@/">http://www.five-ten-sg.com/@PACKAGE@/</ulink>. |
752d4315675c
add reference to mercurial repository in the documentation
Carl Byington <carl@five-ten-sg.com>
parents:
187
diff
changeset
|
10 </para> |
752d4315675c
add reference to mercurial repository in the documentation
Carl Byington <carl@five-ten-sg.com>
parents:
187
diff
changeset
|
11 |
752d4315675c
add reference to mercurial repository in the documentation
Carl Byington <carl@five-ten-sg.com>
parents:
187
diff
changeset
|
12 <para>A <ulink |
752d4315675c
add reference to mercurial repository in the documentation
Carl Byington <carl@five-ten-sg.com>
parents:
187
diff
changeset
|
13 url="http://www.selenic.com/mercurial/wiki/">Mercurial</ulink> source |
752d4315675c
add reference to mercurial repository in the documentation
Carl Byington <carl@five-ten-sg.com>
parents:
187
diff
changeset
|
14 code repository for this project is available at <ulink |
752d4315675c
add reference to mercurial repository in the documentation
Carl Byington <carl@five-ten-sg.com>
parents:
187
diff
changeset
|
15 url="http://hg.five-ten-sg.com/@PACKAGE@/">http://hg.five-ten-sg.com/@PACKAGE@/</ulink>. |
108 | 16 </para> |
94 | 17 |
108 | 18 </partintro> |
94 | 19 |
108 | 20 <refentry id="@PACKAGE@.1"> |
21 <refentryinfo> | |
253
2d6ecd03bbbe
update date on the man pages
Carl Byington <carl@five-ten-sg.com>
parents:
249
diff
changeset
|
22 <date>2012-04-08</date> |
108 | 23 </refentryinfo> |
94 | 24 |
108 | 25 <refmeta> |
26 <refentrytitle>@PACKAGE@</refentrytitle> | |
27 <manvolnum>1</manvolnum> | |
28 <refmiscinfo>@PACKAGE@ @VERSION@</refmiscinfo> | |
29 </refmeta> | |
30 | |
31 <refnamediv id='name.1'> | |
32 <refname>@PACKAGE@</refname> | |
33 <refpurpose>a sendmail milter with per-user dnsbl filtering</refpurpose> | |
34 </refnamediv> | |
94 | 35 |
108 | 36 <refsynopsisdiv id='synopsis.1'> |
37 <title>Synopsis</title> | |
38 <cmdsynopsis> | |
39 <command>@PACKAGE@</command> | |
40 <arg><option>-c</option></arg> | |
41 <arg><option>-s</option></arg> | |
42 <arg><option>-d <replaceable class="parameter">n</replaceable></option></arg> | |
43 <arg><option>-e <replaceable class="parameter">from|to</replaceable></option></arg> | |
179 | 44 <arg><option>-b <replaceable class="parameter">local-domain-socket</replaceable></option></arg> |
108 | 45 <arg><option>-r <replaceable class="parameter">local-domain-socket</replaceable></option></arg> |
46 <arg><option>-p <replaceable class="parameter">sendmail-socket</replaceable></option></arg> | |
47 <arg><option>-t <replaceable class="parameter">timeout</replaceable></option></arg> | |
48 </cmdsynopsis> | |
49 </refsynopsisdiv> | |
94 | 50 |
108 | 51 <refsect1 id='options.1'> |
52 <title>Options</title> | |
53 <variablelist> | |
54 <varlistentry> | |
55 <term>-c</term> | |
111 | 56 <listitem><para> |
57 Load the configuration file, print a cannonical form | |
58 of the configuration on stdout, and exit. | |
59 </para></listitem> | |
108 | 60 </varlistentry> |
61 <varlistentry> | |
62 <term>-s</term> | |
111 | 63 <listitem><para> |
64 Stress test the configuration loading code by repeating | |
65 the load/free cycle in an infinite loop. | |
66 </para></listitem> | |
108 | 67 </varlistentry> |
68 <varlistentry> | |
69 <term>-d <replaceable class="parameter">n</replaceable></term> | |
111 | 70 <listitem><para> |
71 Set the debug level to <replaceable class="parameter">n</replaceable>. | |
72 </para></listitem> | |
108 | 73 </varlistentry> |
74 <varlistentry> | |
75 <term>-e <replaceable class="parameter">from|to</replaceable></term> | |
111 | 76 <listitem><para> |
77 Print the results of looking up the from and to addresses in the | |
78 current configuration. The | character is used to separate the from and to | |
79 addresses in the argument to the -e switch. | |
80 </para></listitem> | |
108 | 81 </varlistentry> |
82 <varlistentry> | |
179 | 83 <term>-b <replaceable class="parameter">local-domain-socket-file-name</replaceable></term> |
84 <listitem><para> | |
85 Set the local socket used for the connection to the dccifd daemon. | |
86 This is typically /var/dcc/dccifd. | |
87 </para></listitem> | |
88 </varlistentry> | |
89 <varlistentry> | |
90 <term>-r <replaceable class="parameter">local-domain-socket-file-name</replaceable></term> | |
111 | 91 <listitem><para> |
92 Set the local socket used for the connection to our own dns resolver processes. | |
93 </para></listitem> | |
108 | 94 </varlistentry> |
95 <varlistentry> | |
96 <term>-p <replaceable class="parameter">sendmail-socket</replaceable></term> | |
111 | 97 <listitem><para> |
98 Set the socket used for the milter connection to sendmail. This is either | |
99 "inet:port@ip-address" or "local:local-domain-socket-file-name". | |
100 </para></listitem> | |
108 | 101 </varlistentry> |
102 <varlistentry> | |
103 <term>-t <replaceable class="parameter">timeout</replaceable></term> | |
111 | 104 <listitem><para> |
105 Set the timeout in seconds used for communication with sendmail. | |
106 </para></listitem> | |
108 | 107 </varlistentry> |
108 </variablelist> | |
109 </refsect1> | |
94 | 110 |
111 | 111 <refsect1 id='usage.1'> |
108 | 112 <title>Usage</title> |
113 <para><command>@PACKAGE@</command> -c</para> | |
114 <para><command>@PACKAGE@</command> -s</para> | |
111 | 115 <para><command>@PACKAGE@</command> -e 'someone@aol.com|localname@mydomain.tld'</para> |
116 <para><command>@PACKAGE@</command> -d 10 -r resolver.sock -p local:dnsbl.sock</para> | |
117 </refsect1> | |
118 | |
119 <refsect1 id='installation.1'> | |
120 <title>Installation</title> | |
121 <para> | |
122 This is now a standard GNU autoconf/automake installation, so the normal | |
123 "./configure; make; su; make install" works. "make chkconfig" will | |
124 setup the init.d runlevel scripts. Alternatively, you can use the | |
125 source or binary RPMs at <ulink | |
126 url="http://www.five-ten-sg.com/@PACKAGE@/packages">http://www.five-ten-sg.com/@PACKAGE@/packages</ulink>. | |
127 </para> | |
128 <para> | |
129 Note that this has ONLY been tested on Linux, specifically RedHat Linux. | |
130 In particular, this milter makes no attempt to understand IPv6. Your | |
131 mileage will vary. You will need at a minimum a C++ compiler with a | |
132 minimally thread safe STL implementation. The distribution includes a | |
133 test.cpp program. If it fails this milter won't work. If it passes, | |
134 this milter might work. | |
135 </para> | |
136 <para> | |
137 Modify your sendmail.mc by removing all the "FEATURE(dnsbl" lines, add | |
138 the following line in your sendmail.mc and rebuild the .cf file | |
139 </para> | |
140 <para><screen>INPUT_MAIL_FILTER(`dnsbl', `S=local:/var/run/dnsbl/dnsbl.sock, F=T, T=C:30s;S:5m;R:5m;E:5m')</screen></para> | |
141 <para> | |
142 Modify the default <citerefentry> | |
143 <refentrytitle>@PACKAGE@.conf</refentrytitle> <manvolnum>5</manvolnum> | |
144 </citerefentry> configuration. | |
145 </para> | |
146 </refsect1> | |
147 | |
148 <refsect1 id='configuration.1'> | |
149 <title>Configuration</title> | |
150 <para> | |
151 The configuration file is documented in <citerefentry> | |
152 <refentrytitle>@PACKAGE@.conf</refentrytitle> <manvolnum>5</manvolnum> | |
153 </citerefentry>. Any change to the config file, or any file included | |
154 from that config file, will cause it to be reloaded within three | |
155 minutes. | |
156 </para> | |
108 | 157 </refsect1> |
94 | 158 |
108 | 159 <refsect1 id='introduction.1'> |
160 <title>Introduction</title> | |
161 <para> | |
162 Consider the case of a mail server that is acting as secondary MX for a | |
163 collection of clients, each of which has a collection of mail domains. | |
164 Each client may use their own collection of DNSBLs on their primary mail | |
165 server. We present here a mechanism whereby the backup mail server can | |
166 use the correct set of DNSBLs for each recipient for each message. As a | |
167 side-effect, it gives us the ability to customize the set of DNSBLs on a | |
183 | 168 per-recipient basis, so that fred@example.com could use LOCAL and the |
108 | 169 SBL, where all other users @example.com use only the SBL. |
170 </para> | |
171 <para> | |
172 This milter can also verify the envelope from/recipient pairs with the | |
173 primary MX server. This allows the backup mail servers to properly | |
174 reject mail sent to invalid addresses. Otherwise, the backup mail | |
175 servers will accept that mail, and then generate a bounce message when | |
176 the message is forwarded to the primary server (and rejected there with | |
127 | 177 no such user). These rejections are the primary cause of such backscatter. |
108 | 178 </para> |
179 <para> | |
180 This milter will also decode (uuencode, base64, mime, html entity, url | |
181 encodings) and scan for HTTP and HTTPS URLs and bare hostnames in the | |
182 body of the mail. If any of those host names have A or NS records on | |
183 the SBL (or a single configurable DNSBL), the mail will be rejected | |
184 unless previously whitelisted. This milter also counts the number of | |
185 invalid HTML tags, and can reject mail if that count exceeds your | |
186 specified limit. | |
187 </para> | |
188 <para> | |
136 | 189 This milter can also impose hourly rate limits on the number of |
190 recipients accepted from SMTP AUTH connections, that would otherwise be | |
191 allowed to relay thru this mail server with no spam filtering. | |
192 </para> | |
193 <para> | |
162 | 194 Consider the case of a message from A to B passing thru this milter. If |
195 that message is not blocked, then we might eventually see a reply | |
156 | 196 message from B to A. If the filtering context for A includes an |
162 | 197 autowhite entry, and that context does <emphasis>not</emphasis> cover B |
198 as a recipient, then this milter will add an entry in that file to | |
199 whitelist such replies for a configurable time period. Suppose A and B | |
200 are in the same domain, or at least use the same filtering context. In | |
201 that case we don't want to add a whitelist entry for B, since that would | |
202 then allow spammers to send mail from B (forged) to B. Such autowhite | |
160 | 203 files need to be writeable by the dnsbl user, where all the other dnsbl |
204 configuration files only need to be readable by the dnsbl user. | |
156 | 205 </para> |
206 <para> | |
176
4ec928b24bab
allow manual whitelisting with stamp 1 to remove a whitelist entry
carl
parents:
175
diff
changeset
|
207 You can manually add such an autowhite entry, by appending a single |
4ec928b24bab
allow manual whitelisting with stamp 1 to remove a whitelist entry
carl
parents:
175
diff
changeset
|
208 text line to the autowhitelist file, using something like |
4ec928b24bab
allow manual whitelisting with stamp 1 to remove a whitelist entry
carl
parents:
175
diff
changeset
|
209 <command>echo "$mail 0" >>$autowhitefile</command>. |
4ec928b24bab
allow manual whitelisting with stamp 1 to remove a whitelist entry
carl
parents:
175
diff
changeset
|
210 You can manually remove such an autowhite entry, by appending a single |
4ec928b24bab
allow manual whitelisting with stamp 1 to remove a whitelist entry
carl
parents:
175
diff
changeset
|
211 text line to the autowhitelist file, using something like |
4ec928b24bab
allow manual whitelisting with stamp 1 to remove a whitelist entry
carl
parents:
175
diff
changeset
|
212 <command>echo "$mail 1" >>$autowhitefile</command>. |
4ec928b24bab
allow manual whitelisting with stamp 1 to remove a whitelist entry
carl
parents:
175
diff
changeset
|
213 </para> |
4ec928b24bab
allow manual whitelisting with stamp 1 to remove a whitelist entry
carl
parents:
175
diff
changeset
|
214 <para> |
108 | 215 The DNSBL milter reads a text configuration file (dnsbl.conf) on |
216 startup, and whenever the config file (or any of the referenced include | |
217 files) is changed. The entire configuration file is case insensitive. | |
218 If the configuration cannot be loaded due to a syntax error, the milter | |
219 will log the error and quit. If the configuration cannot be reloaded | |
220 after being modified, the milter will log the error and send an email to | |
152 | 221 root from dnsbl@$hostname. You probably want to add dnsbl@$hostname |
108 | 222 to your /etc/mail/virtusertable since otherwise sendmail will reject |
223 that message. | |
224 </para> | |
225 </refsect1> | |
94 | 226 |
111 | 227 <refsect1 id='dcc.1'> |
108 | 228 <title>DCC Issues</title> |
229 <para> | |
230 If you are also using the <ulink | |
231 url="http://www.rhyolite.com/anti-spam/dcc/">DCC</ulink> milter, there | |
232 are a few considerations. You may need to whitelist senders from the | |
233 DCC bulk detector, or from the DNS based lists. Those are two very | |
234 different reasons for whitelisting. The former is done thru the DCC | |
235 whiteclnt config file, the later is done thru the DNSBL milter config | |
236 file. | |
237 </para> | |
238 <para> | |
239 You may want to blacklist some specific senders or sending domains. | |
240 This could be done thru either the DCC (on a global basis, or for a | |
241 specific single recipient). We prefer to do such blacklisting via the | |
242 DNSBL milter config, since it can be done for a collection of recipient | |
243 mail domains. The DCC approach has the feature that you can capture the | |
244 entire message in the DCC log files. The DNSBL milter approach has the | |
245 feature that the mail is rejected earlier (at RCPT TO time), and the | |
246 sending machine just gets a generic "550 5.7.1 no such user" message. | |
247 </para> | |
248 <para> | |
249 The DCC whiteclnt file can be included in the DNSBL milter config by the | |
250 dcc_to and dcc_from statements. This will import the (env_to, env_from, | |
251 and substitute mail_host) entries from the DCC config into the DNSBL | |
252 config. This allows using the DCC config as the single point for | |
253 white/blacklisting. | |
254 </para> | |
255 <para> | |
256 Consider the case where you have multiple clients, each with their own | |
257 mail servers, and each running their own DCC milters. Each client is | |
258 using the DCC facilities for envelope from/to white/blacklisting. | |
259 Presumably you can use rsync or scp to fetch copies of your clients DCC | |
260 whiteclnt files on a regular basis. Your mail server, acting as a | |
261 backup MX for your clients, can use the DNSBL milter, and include those | |
262 client DCC config files. The envelope from/to white/blacklisting will | |
263 be appropriately tagged and used only for the domains controlled by each | |
264 of those clients. | |
265 </para> | |
179 | 266 <para> |
267 You can now use (via dccifd) different dcc filtering parameters on a per | |
268 context basis. See the dcc_greylist and dcc_bulk_threshold statements | |
269 in the <citerefentry> <refentrytitle>@PACKAGE@.conf</refentrytitle> | |
270 <manvolnum>5</manvolnum> </citerefentry> configuration. Those | |
271 statements are only active if you supply the <option>-b</option> option | |
272 on the dnsbl command line. If you use the dcc via the standard dcc | |
273 milter (dccm), then connections from clients that use SMTP AUTH are | |
274 still subject to greylisting. If you use the dcc via dccifd and this | |
275 milter, then connections from clients that use SMTP AUTH are never | |
180 | 276 subject to greylisting. As part of this per-user greylisting, you need |
277 to move the dnsblnogrey file from the config directory to something | |
278 like /var/dcc/userdirs/local/dnsblnogrey/whiteclnt so the dccifd will | |
279 properly ignore greylisting for those recipients that don't want it. | |
179 | 280 </para> |
108 | 281 </refsect1> |
94 | 282 |
111 | 283 <refsect1 id='definitions.1'> |
108 | 284 <title>Definitions</title> |
285 <para> | |
286 CONTEXT - a collection of parameters that defines the filtering context | |
287 to be used for a collection of envelope recipient addresses. The | |
288 context includes such things as the list of DNSBLs to be used, and the | |
289 various content filtering parameters. | |
290 </para> | |
291 <para> | |
292 DNSBL - a named DNS based blocking list is defined by a dns suffix (e.g. | |
293 sbl-xbl.spamhaus.org) and a message string that is used to generate the | |
294 "550 5.7.1" smtp error return code. The names of these DNSBLs will be | |
295 used to define the DNSBL-LISTs. | |
296 </para> | |
297 <para> | |
298 DNSBL-LIST - a named list of DNSBLs that will be used for specific | |
299 recipients or recipient domains. | |
300 </para> | |
249 | 301 <para> |
302 DNSWL - a named DNS based white list is defined by a dns suffix (e.g. | |
303 list.dnswl.org) and an integer level. If the level is greater than or | |
304 equal to x in the 127.0.z.x return code from the white list, then the | |
305 ip address is considered to match, and the message will be whitelisted. | |
306 The names of these DNSWLs will be used to define the DNSWL-LISTs. | |
307 </para> | |
308 <para> | |
309 DNSWL-LIST - a named list of DNSWLs that will be used for specific | |
310 recipients or recipient domains. | |
311 </para> | |
108 | 312 </refsect1> |
94 | 313 |
111 | 314 <refsect1 id='filtering.1'> |
108 | 315 <title>Filtering Procedure</title> |
316 <para> | |
152 | 317 The SMTP envelope 'from' and 'to' values are used in various checks. |
318 The first check is to see if a reply message (swapping the env_from and | |
160 | 319 env_to values) would be unconditionally blocked (just based on the |
320 envelope from address). That check is similar to the main check | |
321 described below, but there is no body content to be scanned, and there | |
322 is no client connection ip address to be checked against DNSBLs. If | |
323 such a reply message would be blocked, we also block the original | |
324 outgoing message. This prevents folks from sending mail to recipients | |
325 that are unable to reply. | |
152 | 326 </para> |
327 <para> | |
136 | 328 If the client has authenticated with sendmail, the rate limits are |
329 checked. If the authenticated user has not exceeded the hourly rate | |
144
31ff00ea6bfb
allow parent/child to share a fully qualified env_to address
carl
parents:
140
diff
changeset
|
330 limit, then the mail is accepted, the filtering contexts are not used, |
136 | 331 the dns lists are not checked, and the body content is not scanned. If |
332 the client has not authenticated with sendmail, we follow these steps | |
333 for each recipient. | |
108 | 334 </para> |
335 <orderedlist> | |
111 | 336 <listitem><para> |
108 | 337 The envelope to email address is used to find an initial filtering |
338 context. We first look for a context that specified the full email | |
339 address in the env_to statement. If that is not found, we look for a | |
340 context that specified the entire domain name of the envelope recipient | |
341 in the env_to statement. If that is not found, we look for a context | |
342 that specified the user@ part of the envelope recipient in the env_to | |
343 statement. If that is not found, we use the first top level context | |
344 defined in the config file. | |
111 | 345 </para></listitem> |
346 <listitem><para> | |
108 | 347 The initial filtering context may redirect to a child context based on |
348 the values in the initial context's env_from statement. We look for [1) | |
349 the full envelope from email address, 2) the domain name part of the | |
350 envelope from address, 3) the user@ part of the envelope from address] | |
351 in that context's env_from statement, with values that point to a child | |
352 context. If such an entry is found, we switch to that child filtering | |
353 context. | |
111 | 354 </para></listitem> |
355 <listitem><para> | |
108 | 356 We lookup [1) the full envelope from email address, 2) the domain name |
357 part of the envelope from address, 3) the user@ part of the envelope | |
358 from address] in the filtering context env_from statement. That results | |
359 in one of (white, black, unknown, inherit). | |
111 | 360 </para></listitem> |
361 <listitem><para> | |
108 | 362 If the answer is black, mail to this recipient is rejected with "no such |
363 user", and the dns lists are not checked. | |
111 | 364 </para></listitem> |
365 <listitem><para> | |
108 | 366 If the answer is white, mail to this recipient is accepted and the dns |
367 lists are not checked. | |
111 | 368 </para></listitem> |
369 <listitem><para> | |
108 | 370 If the answer is unknown, we don't reject yet, but the dns lists will be |
371 checked, and the content may be scanned. | |
111 | 372 </para></listitem> |
373 <listitem><para> | |
108 | 374 If the answer is inherit, we repeat the envelope from search in the |
375 parent context. | |
111 | 376 </para></listitem> |
377 <listitem><para> | |
233
5c3e9bf45bb5
Add whitelisting by regex expression filtering.
Carl Byington <carl@five-ten-sg.com>
parents:
216
diff
changeset
|
378 If the mail has not been accepted or rejected yet, and the filtering |
5c3e9bf45bb5
Add whitelisting by regex expression filtering.
Carl Byington <carl@five-ten-sg.com>
parents:
216
diff
changeset
|
379 context (or any ancestor context) specifies a non-empty whitelist regular |
5c3e9bf45bb5
Add whitelisting by regex expression filtering.
Carl Byington <carl@five-ten-sg.com>
parents:
216
diff
changeset
|
380 expression, then we check the envelope from value against that regex. |
5c3e9bf45bb5
Add whitelisting by regex expression filtering.
Carl Byington <carl@five-ten-sg.com>
parents:
216
diff
changeset
|
381 The mail is accepted if the envelope from value matches the specified regular |
5c3e9bf45bb5
Add whitelisting by regex expression filtering.
Carl Byington <carl@five-ten-sg.com>
parents:
216
diff
changeset
|
382 expression. |
5c3e9bf45bb5
Add whitelisting by regex expression filtering.
Carl Byington <carl@five-ten-sg.com>
parents:
216
diff
changeset
|
383 </para></listitem> |
5c3e9bf45bb5
Add whitelisting by regex expression filtering.
Carl Byington <carl@five-ten-sg.com>
parents:
216
diff
changeset
|
384 <listitem><para> |
249 | 385 If the mail has not been accepted or rejected yet, the dns white lists |
386 specified in the filtering context are checked and the mail is accepted | |
387 if any list has an A record for the standard dns based lookup scheme | |
388 (reversed octets of the client followed by the dns suffix) with a final | |
389 octet greater than or equal to the level specified for that dnswl. | |
390 </para></listitem> | |
391 <listitem><para> | |
392 If the mail has not been accepted or rejected yet, the dns black lists | |
168 | 393 specified in the filtering context are checked and the mail is rejected |
394 if any list has an A record for the standard dns based lookup scheme | |
395 (reversed octets of the client followed by the dns suffix). | |
396 </para></listitem> | |
397 <listitem><para> | |
398 If the mail has not been accepted or rejected yet, and the filtering | |
170 | 399 context (or any ancestor context) specifies a non-empty generic regular |
400 expression, then we check the fully qualified client name (obtained via | |
401 the sendmail macro "_"). The mail is rejected if the client name | |
402 matches the specified regular expression. | |
111 | 403 </para></listitem> |
404 <listitem><para> | |
108 | 405 If the mail has not been accepted or rejected yet, we look for a |
406 verification context, which is the closest ancestor of the filtering | |
407 context that both specifies a verification host, and which covers the | |
408 envelope to address. If we find such a verification context, and the | |
409 verification host is not our own hostname, we open an smtp conversation | |
410 with that verification host. The current envelope from and recipient to | |
411 values are passed to that verification host. If we receive a 5xy | |
412 response those commands, we reject the current recipient with "no such | |
413 user". | |
111 | 414 </para></listitem> |
415 <listitem><para> | |
108 | 416 If the mail has not been accepted or rejected yet, and the filtering |
417 context enables content filtering, and this is the first such recipient | |
418 in this smtp transaction, we set the content filtering parameters from | |
419 this context, and enable content filtering for the body of this message. | |
111 | 420 </para></listitem> |
108 | 421 </orderedlist> |
422 <para> | |
160 | 423 For each recipient that was accepted, we search for an autowhite entry |
424 starting in the reply filtering context. If an autowhite entry is found, | |
425 we add the recipient to that auto whitelist file. This will prevent reply | |
426 messages from being blocked by the dnsbl or content filtering. | |
427 </para> | |
428 <para> | |
108 | 429 If content filtering is enabled for this body, the mail text is decoded |
119 | 430 (uuencode, base64, mime, html entity, url encodings), and scanned for HTTP |
431 and HTTPS URLs or bare host names. Hostnames must be either ip address | |
432 literals, or must end in a string defined by the TLD list. The first | |
433 <configurable> host names are checked as follows. | |
434 </para> | |
435 <para> | |
436 The only known list that is suitable for the content filter DNSBL is the | |
437 SBL. If the content filter DNSBL is defined, and any of those host | |
438 names resolve to ip addresses that are on that DNSBL (or have | |
439 nameservers that are on that list), and the host name is not on the | |
440 <configurable> ignore list, the mail is rejected. | |
441 </para> | |
442 <para> | |
443 If the content uribl DNSBL is defined, and any of those host names are | |
444 on that DNSBL, and the host name is not on the <configurable> | |
249 | 445 ignore list, the mail is rejected. Note that the Spamhaus DBL is not (yet) |
446 suitable here, since we currently pass ip addresses to the uribl checker, | |
447 and the DBL lists all such bare ip addresses. | |
119 | 448 </para> |
449 <para> | |
167
9b129ed78d7d
actually use spamassassin result, allow build without spam assassin, only call it if some recipient needs it.
carl
parents:
164
diff
changeset
|
450 If any non-whitelisted recipient has a filtering context with a non-zero |
9b129ed78d7d
actually use spamassassin result, allow build without spam assassin, only call it if some recipient needs it.
carl
parents:
164
diff
changeset
|
451 spamassassin limit, then the message is passed thru spamassassin (via |
9b129ed78d7d
actually use spamassassin result, allow build without spam assassin, only call it if some recipient needs it.
carl
parents:
164
diff
changeset
|
452 spamc), and the message is rejected for those recipients with spamassassin |
203
92a5c866bdfa
Verify from/to pairs even if they might be explicitly whitelisted.
Carl Byington <carl@five-ten-sg.com>
parents:
201
diff
changeset
|
453 limits less than the resulting spamassassin score. For example, a |
92a5c866bdfa
Verify from/to pairs even if they might be explicitly whitelisted.
Carl Byington <carl@five-ten-sg.com>
parents:
201
diff
changeset
|
454 spamassassin limit of three will reject messages with spamassassin scores |
246
8b0f16abee53
Add prvs decoding to envelope addresses
Carl Byington <carl@five-ten-sg.com>
parents:
233
diff
changeset
|
455 of four or greater. If the filtering context has a spamassassin limit of |
8b0f16abee53
Add prvs decoding to envelope addresses
Carl Byington <carl@five-ten-sg.com>
parents:
233
diff
changeset
|
456 zero, then spamassassin is not called (or if called the results are not used) |
8b0f16abee53
Add prvs decoding to envelope addresses
Carl Byington <carl@five-ten-sg.com>
parents:
233
diff
changeset
|
457 for this recipient. |
203
92a5c866bdfa
Verify from/to pairs even if they might be explicitly whitelisted.
Carl Byington <carl@five-ten-sg.com>
parents:
201
diff
changeset
|
458 </para> |
92a5c866bdfa
Verify from/to pairs even if they might be explicitly whitelisted.
Carl Byington <carl@five-ten-sg.com>
parents:
201
diff
changeset
|
459 <para> |
92a5c866bdfa
Verify from/to pairs even if they might be explicitly whitelisted.
Carl Byington <carl@five-ten-sg.com>
parents:
201
diff
changeset
|
460 If any non-whitelisted recipient has a filtering context that specifies |
92a5c866bdfa
Verify from/to pairs even if they might be explicitly whitelisted.
Carl Byington <carl@five-ten-sg.com>
parents:
201
diff
changeset
|
461 DCC greylisting, then the message is passed thru the DCC bulk detector, |
92a5c866bdfa
Verify from/to pairs even if they might be explicitly whitelisted.
Carl Byington <carl@five-ten-sg.com>
parents:
201
diff
changeset
|
462 and the message is greylisted (for all recipients) if the DCC says this |
92a5c866bdfa
Verify from/to pairs even if they might be explicitly whitelisted.
Carl Byington <carl@five-ten-sg.com>
parents:
201
diff
changeset
|
463 message should be delayed. |
92a5c866bdfa
Verify from/to pairs even if they might be explicitly whitelisted.
Carl Byington <carl@five-ten-sg.com>
parents:
201
diff
changeset
|
464 </para> |
92a5c866bdfa
Verify from/to pairs even if they might be explicitly whitelisted.
Carl Byington <carl@five-ten-sg.com>
parents:
201
diff
changeset
|
465 <para> |
92a5c866bdfa
Verify from/to pairs even if they might be explicitly whitelisted.
Carl Byington <carl@five-ten-sg.com>
parents:
201
diff
changeset
|
466 If any non-whitelisted recipient has a filtering context with a non-zero |
92a5c866bdfa
Verify from/to pairs even if they might be explicitly whitelisted.
Carl Byington <carl@five-ten-sg.com>
parents:
201
diff
changeset
|
467 DCC bulk threshold, then the message is passed thru the DCC bulk detector, |
92a5c866bdfa
Verify from/to pairs even if they might be explicitly whitelisted.
Carl Byington <carl@five-ten-sg.com>
parents:
201
diff
changeset
|
468 and the message is rejected for those recipients with DCC thresholds less |
92a5c866bdfa
Verify from/to pairs even if they might be explicitly whitelisted.
Carl Byington <carl@five-ten-sg.com>
parents:
201
diff
changeset
|
469 than or equal to the DCC bulk score. |
163 | 470 </para> |
471 <para> | |
119 | 472 We also scan for excessive bad html tags, and if a <configurable> |
473 limit is exceeded, the mail is rejected. | |
108 | 474 </para> |
475 </refsect1> | |
94 | 476 |
111 | 477 <refsect1 id='access.1'> |
108 | 478 <title>Sendmail access vs. DNSBL</title> |
479 <para> | |
480 With the standard sendmail.mc dnsbl FEATURE, the dnsbl checks may be | |
481 suppressed by entries in the /etc/mail/access database. For example, | |
482 suppose you control a /18 of address space, and have allocated some /24s | |
483 to some clients. You have access entries like | |
111 | 484 <literallayout class="monospaced"><![CDATA[ |
485 192.168.4 OK | |
486 192.168.17 OK]]></literallayout> | |
108 | 487 </para> |
488 <para> | |
489 to allow those clients to smarthost thru your mail server. Now if one | |
490 of those clients happens get infected with a virus that turns a machine | |
491 into an open proxy, and their 192.168.4.45 lands on the SBL-XBL, you | |
492 will still wind up allowing that infected machine to smarthost thru your | |
493 mail servers. | |
494 </para> | |
495 <para> | |
496 With this DNSBL milter, the sendmail access database cannot override the | |
497 dnsbl checks, so that machine won't be able to send mail to or thru your | |
498 smarthost mail server (unless the virus/proxy can use smtp-auth). | |
499 </para> | |
500 <para> | |
501 Using the standard sendmail features, you would add access entries to | |
502 allow hosts on your local network to relay thru your mail server. Those | |
503 OK entries in the sendmail access database will override all the dnsbl | |
504 checks. With this DNSBL milter, you will need to have the local users | |
505 authenticate with smtp-auth to get the same effect. You might find | |
506 <ulink | |
507 url="http://www.ists.dartmouth.edu/classroom/sendmail-ssl-how-to.php"> | |
508 these directions</ulink> helpful for setting up smtp-auth if you are on | |
509 RH Linux. | |
510 </para> | |
511 </refsect1> | |
94 | 512 |
111 | 513 <refsect1 id='performance.1'> |
108 | 514 <title>Performance Issues</title> |
515 <para> | |
516 Consider a high volume high performance machine running sendmail. Each | |
517 sendmail process can do its own dns resolution. Typically, such dns | |
518 resolver libraries are not thread safe, and so must be protected by some | |
519 sort of mutex in a threaded environment. When we add a milter to | |
520 sendmail, we now have a collection of sendmail processes, and a | |
521 collection of milter threads. | |
522 </para> | |
523 <para> | |
524 We will be doing a lot of dns lookups per mail message, and at least | |
525 some of those will take many tens of seconds. If all this dns work is | |
526 serialized inside the milter, we have an upper limit of about 25K mail | |
527 messages per day. That is clearly not sufficient for many sites. | |
528 </para> | |
529 <para> | |
530 Since we want to do parallel dns resolution across those milter threads, | |
531 we add another collection of dns resolver processes. Each sendmail | |
532 process is talking to a milter thread over a socket, and each milter | |
533 thread is talking to a dns resolver process over another socket. | |
534 </para> | |
535 <para> | |
536 Suppose we are processing 20 messages per second, and each message | |
537 requires 20 seconds of dns work. Then we will have 400 sendmail | |
538 processes, 400 milter threads, and 400 dns resolver processes. Of | |
539 course that steady state is very unlikely to happen. | |
540 </para> | |
541 </refsect1> | |
94 | 542 |
543 | |
111 | 544 <refsect1 id='rejected.1'> |
108 | 545 <title>Rejected Ideas</title> |
546 <para> | |
547 The following ideas have been considered and rejected. | |
548 </para> | |
549 <para> | |
111 | 550 Add max_recipients setting to the context configuration. Recipients in |
551 excess of that limit will be rejected, and all the non-whitelisted | |
552 recipients will be removed. Current spammers *very* rarely send more | |
553 than ten recipients in a single smtp transaction, so this won't stop any | |
108 | 554 significant amount of spam. |
555 </para> | |
556 <para> | |
557 Add poison addresses to the configuration. If any recipient is | |
558 poison, all recipients are rejected even if they would be whitelisted, | |
559 and the data is rejected if sent. I have a collection of spam trap | |
560 addresses that would be suitable for such use. Based on my log files, | |
561 any mail to those spam trap addresses is rejected based on either dnsbl | |
562 lookups or the DCC. So this won't result in blocking any additional | |
563 spam. | |
564 </para> | |
565 <para> | |
566 Add an option to only allow one recipient if the return path is | |
567 empty. Based on my log files, there is no mail that violates this | |
568 check. | |
569 </para> | |
570 <para> | |
571 Reject the mail if the envelope from domain name contains any MX | |
572 records pointing to 127.0.0.0/8. I don't see any significant amount of | |
573 spam sent with such domain names. | |
574 </para> | |
575 </refsect1> | |
94 | 576 |
108 | 577 <refsect1 id='todo.1'> |
578 <title>TODO</title> | |
579 <para> | |
580 The following ideas are under consideration. | |
581 </para> | |
582 <para> | |
115 | 583 Look for href="hostname/path" strings that are missing the required |
584 http:// protocol header. Such references are still clickable in common | |
585 mail software. | |
586 </para> | |
249 | 587 <para> |
588 Add the ability to use the DBL for content filtering. We need to avoid | |
589 checking bare ip addresses against that list. | |
590 </para> | |
591 <para> | |
592 Add daily recipient limits based on some fixed multiple (perhaps 3?) | |
593 of the hourly limit. | |
594 </para> | |
108 | 595 </refsect1> |
94 | 596 |
111 | 597 <refsect1 id='copyright.1'> |
108 | 598 <title>Copyright</title> |
599 <para> | |
163 | 600 Copyright (C) 2007 by 510 Software Group <carl@five-ten-sg.com> |
108 | 601 </para> |
602 <para> | |
603 This program is free software; you can redistribute it and/or modify it | |
604 under the terms of the GNU General Public License as published by the | |
160 | 605 Free Software Foundation; either version 3, or (at your option) any |
108 | 606 later version. |
607 </para> | |
608 <para> | |
609 You should have received a copy of the GNU General Public License along | |
610 with this program; see the file COPYING. If not, please write to the | |
611 Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
612 </para> | |
613 </refsect1> | |
94 | 614 |
111 | 615 <refsect1 id='version.1'> |
201
752d4315675c
add reference to mercurial repository in the documentation
Carl Byington <carl@five-ten-sg.com>
parents:
187
diff
changeset
|
616 <title>Version</title> |
108 | 617 <para> |
201
752d4315675c
add reference to mercurial repository in the documentation
Carl Byington <carl@five-ten-sg.com>
parents:
187
diff
changeset
|
618 @VERSION@ |
108 | 619 </para> |
620 </refsect1> | |
621 </refentry> | |
622 | |
623 | |
624 <refentry id="@PACKAGE@.conf.5"> | |
625 <refentryinfo> | |
253
2d6ecd03bbbe
update date on the man pages
Carl Byington <carl@five-ten-sg.com>
parents:
249
diff
changeset
|
626 <date>2012-04-08</date> |
108 | 627 </refentryinfo> |
94 | 628 |
108 | 629 <refmeta> |
630 <refentrytitle>@PACKAGE@.conf</refentrytitle> | |
631 <manvolnum>5</manvolnum> | |
632 <refmiscinfo>@PACKAGE@ @VERSION@</refmiscinfo> | |
633 </refmeta> | |
94 | 634 |
108 | 635 <refnamediv id='name.5'> |
636 <refname>@PACKAGE@.conf</refname> | |
111 | 637 <refpurpose>configuration file for @PACKAGE@ sendmail milter</refpurpose> |
108 | 638 </refnamediv> |
639 | |
640 <refsynopsisdiv id='synopsis.5'> | |
641 <title>Synopsis</title> | |
642 <cmdsynopsis> | |
643 <command>@PACKAGE@.conf</command> | |
644 </cmdsynopsis> | |
645 </refsynopsisdiv> | |
94 | 646 |
108 | 647 <refsect1 id='description.5'> |
648 <title>Description</title> | |
649 <para>The <command>@PACKAGE@.conf</command> configuration file is | |
148
9330b8d6a56b
add documentation fixes, allow env_from target of inherit
carl
parents:
144
diff
changeset
|
650 specified by this partial bnf description. Comments start with // |
9330b8d6a56b
add documentation fixes, allow env_from target of inherit
carl
parents:
144
diff
changeset
|
651 or # and extend to the end of the line. To include the contents |
9330b8d6a56b
add documentation fixes, allow env_from target of inherit
carl
parents:
144
diff
changeset
|
652 of some file verbatim in the dnsbl.conf file, use |
9330b8d6a56b
add documentation fixes, allow env_from target of inherit
carl
parents:
144
diff
changeset
|
653 <literallayout class="monospaced"><![CDATA[include "<file>";]]></literallayout> |
9330b8d6a56b
add documentation fixes, allow env_from target of inherit
carl
parents:
144
diff
changeset
|
654 </para> |
108 | 655 |
656 <literallayout class="monospaced"><![CDATA[ | |
657 CONFIG = {CONTEXT ";"}+ | |
658 CONTEXT = "context" NAME "{" {STATEMENT}+ "}" | |
249 | 659 STATEMENT = (DNSBL | DNSBLLIST | DNSWL | DNSWLLIST | CONTENT | ENV-TO |
660 | VERIFY | GENERIC | W_REGEX | AUTOWHITE | CONTEXT | ENV-FROM | |
661 | RATE-LIMIT) ";" | |
108 | 662 |
124 | 663 DNSBL = "dnsbl" NAME DNSPREFIX ERROR-MSG1 |
255
d6d5c50b9278
Allow dnswl_list and dnsbl_list to be empty, to override lists specified in the ancestor contexts. Add daily recipient limits as a multiple of the hourly limits.
Carl Byington <carl@five-ten-sg.com>
parents:
253
diff
changeset
|
664 DNSBLLIST = "dnsbl_list" {NAME}* |
108 | 665 |
255
d6d5c50b9278
Allow dnswl_list and dnsbl_list to be empty, to override lists specified in the ancestor contexts. Add daily recipient limits as a multiple of the hourly limits.
Carl Byington <carl@five-ten-sg.com>
parents:
253
diff
changeset
|
666 DNSWL = "dnswl" NAME DNSPREFIX LEVEL |
d6d5c50b9278
Allow dnswl_list and dnsbl_list to be empty, to override lists specified in the ancestor contexts. Add daily recipient limits as a multiple of the hourly limits.
Carl Byington <carl@five-ten-sg.com>
parents:
253
diff
changeset
|
667 DNSWLLIST = "dnswl_list" {NAME}* |
d6d5c50b9278
Allow dnswl_list and dnsbl_list to be empty, to override lists specified in the ancestor contexts. Add daily recipient limits as a multiple of the hourly limits.
Carl Byington <carl@five-ten-sg.com>
parents:
253
diff
changeset
|
668 LEVEL = INTEGER |
94 | 669 |
108 | 670 CONTENT = "content" ("on" | "off") "{" {CONTENT-ST}+ "}" |
178 | 671 CONTENT-ST = (FILTER | URIBL | IGNORE | TLD | CCTLD | HTML-TAGS | |
672 HTML-LIMIT | HOST-LIMIT | SPAMASS | REQUIRE | DCCGREY | | |
673 DCCBULK) ";" | |
124 | 674 FILTER = "filter" DNSPREFIX ERROR-MSG2 |
675 URIBL = "uribl" DNSPREFIX ERROR-MSG3 | |
108 | 676 IGNORE = "ignore" "{" {HOSTNAME [";"]}+ "}" |
677 TLD = "tld" "{" {TLD [";"]}+ "}" | |
119 | 678 CCTLD = "cctld" "{" {TLD [";"]}+ "}" |
108 | 679 HTML-TAGS = "html_tags" "{" {HTMLTAG [";"]}+ "}" |
124 | 680 ERROR-MSG1 = string containing exactly two %s replacement tokens |
681 both are replaced with the client ip address | |
682 ERROR-MSG2 = string containing exactly two %s replacement tokens | |
683 the first is replaced with the hostname, and the second | |
684 is replaced with the ip address | |
685 ERROR-MSG3 = string containing exactly two %s replacement tokens | |
686 both are replaced with the hostname | |
108 | 687 |
688 HTML-LIMIT = "html_limit" ("on" INTEGER ERROR-MSG | "off") | |
689 | |
111 | 690 HOST-LIMIT = "host_limit" ("on" INTEGER ERROR-MSG | "off" | |
691 "soft" INTEGER) | |
178 | 692 SPAMASS = "spamassassin" INTEGER |
693 REQUIRE = "require_match" ("yes" | "no") | |
694 DCCGREY = "dcc_greylist" ("yes" | "no") | |
695 DCCBULK = "dcc_bulk_threshold" (INTEGER | "many" | "off") | |
94 | 696 |
108 | 697 ENV-TO = "env_to" "{" {(TO-ADDR | DCC-TO)}+ "}" |
698 TO-ADDR = ADDRESS [";"] | |
699 DCC-TO = "dcc_to" ("ok" | "many") "{" DCCINCLUDEFILE "}" ";" | |
700 | |
701 VERIFY = "verify" HOSTNAME ";" | |
168 | 702 GENERIC = "generic" REGULAREXPRESSION ERROR-MSG4 ";" |
233
5c3e9bf45bb5
Add whitelisting by regex expression filtering.
Carl Byington <carl@five-ten-sg.com>
parents:
216
diff
changeset
|
703 W-REGEX = "white_regex" REGULAREXPRESSION ";" |
168 | 704 ERROR-MSG4 = string containing exactly one %s replacement token |
705 which is replaced with the client name | |
153 | 706 AUTOWHITE = "autowhite" DAYS FILENAME ";" |
108 | 707 |
708 ENV_FROM = "env_from" [DEFAULT] "{" {(FROM-ADDR | DCC-FROM)}+ "}" | |
709 FROM-ADDR = ADDRESS VALUE [";"] | |
710 DCC-FROM = "dcc_from" "{" DCCINCLUDEFILE "}" ";" | |
136 | 711 |
255
d6d5c50b9278
Allow dnswl_list and dnsbl_list to be empty, to override lists specified in the ancestor contexts. Add daily recipient limits as a multiple of the hourly limits.
Carl Byington <carl@five-ten-sg.com>
parents:
253
diff
changeset
|
712 RATE-LIMIT = "rate_limit" [DEFAULT_LIMIT [DAILY_MULTIPLE]] "{" (RATE)+ "}" |
d6d5c50b9278
Allow dnswl_list and dnsbl_list to be empty, to override lists specified in the ancestor contexts. Add daily recipient limits as a multiple of the hourly limits.
Carl Byington <carl@five-ten-sg.com>
parents:
253
diff
changeset
|
713 RATE = USER LIMIT [";"] |
d6d5c50b9278
Allow dnswl_list and dnsbl_list to be empty, to override lists specified in the ancestor contexts. Add daily recipient limits as a multiple of the hourly limits.
Carl Byington <carl@five-ten-sg.com>
parents:
253
diff
changeset
|
714 LIMIT = INTEGER |
d6d5c50b9278
Allow dnswl_list and dnsbl_list to be empty, to override lists specified in the ancestor contexts. Add daily recipient limits as a multiple of the hourly limits.
Carl Byington <carl@five-ten-sg.com>
parents:
253
diff
changeset
|
715 DEFAULT_LIMIT = INTEGER |
d6d5c50b9278
Allow dnswl_list and dnsbl_list to be empty, to override lists specified in the ancestor contexts. Add daily recipient limits as a multiple of the hourly limits.
Carl Byington <carl@five-ten-sg.com>
parents:
253
diff
changeset
|
716 DAILY_MULTIPLE = INTEGER |
136 | 717 |
108 | 718 DEFAULT = ("white" | "black" | "unknown" | "inherit" | "") |
719 ADDRESS = (USER@ | DOMAIN | USER@DOMAIN) | |
148
9330b8d6a56b
add documentation fixes, allow env_from target of inherit
carl
parents:
144
diff
changeset
|
720 VALUE = ("white" | "black" | "unknown" | "inherit" | CHILD-CONTEXT-NAME)]]></literallayout> |
108 | 721 </refsect1> |
94 | 722 |
108 | 723 <refsect1 id='sample.5'> |
724 <title>Sample</title> | |
725 <literallayout class="monospaced"><![CDATA[ | |
127 | 726 context main-default { |
727 // outbound dnsbl filtering to catch our own customers that end up on the sbl | |
728 dnsbl sbl sbl-xbl.spamhaus.org "Mail from %s rejected - sbl; see http://www.spamhaus.org/query/bl?ip=%s"; | |
174 | 729 dnsbl_list sbl; |
127 | 730 |
731 // outbound content filtering to prevent our own customers from sending spam | |
732 content on { | |
733 filter sbl-xbl.spamhaus.org "Mail containing %s rejected - sbl; see http://www.spamhaus.org/query/bl?ip=%s"; | |
734 uribl multi.surbl.org "Mail containing %s rejected - surbl; see http://www.rulesemporium.com/cgi-bin/uribl.cgi?bl0=1&domain0=%s"; | |
735 #uribl black.uribl.com "Mail containing %s rejected - uribl; see http://l.uribl.com/?d=%s"; | |
736 ignore { include "hosts-ignore.conf"; }; | |
737 tld { include "tld.conf"; }; | |
738 cctld { include "cctld.conf"; }; | |
739 html_tags { include "html-tags.conf"; }; | |
740 html_limit on 20 "Mail containing excessive bad html tags rejected"; | |
741 html_limit off; | |
742 host_limit on 20 "Mail containing excessive host names rejected"; | |
743 host_limit soft 20; | |
178 | 744 spamassassin 4; |
745 require_match yes; | |
746 dcc_greylist yes; | |
747 dcc_bulk_threshold 50; | |
127 | 748 }; |
749 | |
750 // backscatter prevention - don't send bounces for mail that we accepted but could not forward | |
751 // we only send bounces to our own customers | |
752 env_from unknown { | |
753 "<>" black; | |
754 }; | |
136 | 755 |
144
31ff00ea6bfb
allow parent/child to share a fully qualified env_to address
carl
parents:
140
diff
changeset
|
756 // hourly recipient rate limit by smtp auth client id |
255
d6d5c50b9278
Allow dnswl_list and dnsbl_list to be empty, to override lists specified in the ancestor contexts. Add daily recipient limits as a multiple of the hourly limits.
Carl Byington <carl@five-ten-sg.com>
parents:
253
diff
changeset
|
757 // default hourly limit is 30 |
d6d5c50b9278
Allow dnswl_list and dnsbl_list to be empty, to override lists specified in the ancestor contexts. Add daily recipient limits as a multiple of the hourly limits.
Carl Byington <carl@five-ten-sg.com>
parents:
253
diff
changeset
|
758 // daily limits are 4 times the hourly limit |
d6d5c50b9278
Allow dnswl_list and dnsbl_list to be empty, to override lists specified in the ancestor contexts. Add daily recipient limits as a multiple of the hourly limits.
Carl Byington <carl@five-ten-sg.com>
parents:
253
diff
changeset
|
759 rate_limit 30 4 { // default |
171 | 760 #fred 100; // override default limits |
761 #joe 10; // "" | |
136 | 762 }; |
127 | 763 }; |
764 | |
171 | 765 context main { |
766 dnsbl localp partial.blackholes.five-ten-sg.com "Mail from %s rejected - local; see http://www.five-ten-sg.com/blackhole.php?%s"; | |
108 | 767 dnsbl local blackholes.five-ten-sg.com "Mail from %s rejected - local; see http://www.five-ten-sg.com/blackhole.php?%s"; |
174 | 768 dnsbl sbl zen.spamhaus.org "Mail from %s rejected - sbl; see http://www.spamhaus.org/query/bl?ip=%s"; |
108 | 769 dnsbl xbl xbl.spamhaus.org "Mail from %s rejected - xbl; see http://www.spamhaus.org/query/bl?ip=%s"; |
249 | 770 dnswl dnswl.org list.dnswl.org 2; |
171 | 771 dnsbl_list local sbl; |
249 | 772 dnswl_list dnswl.org; |
94 | 773 |
108 | 774 content on { |
775 filter sbl-xbl.spamhaus.org "Mail containing %s rejected - sbl; see http://www.spamhaus.org/query/bl?ip=%s"; | |
122 | 776 uribl multi.surbl.org "Mail containing %s rejected - surbl; see http://www.rulesemporium.com/cgi-bin/uribl.cgi?bl0=1&domain0=%s"; |
119 | 777 #uribl black.uribl.com "Mail containing %s rejected - uribl; see http://l.uribl.com/?d=%s"; |
108 | 778 ignore { include "hosts-ignore.conf"; }; |
779 tld { include "tld.conf"; }; | |
119 | 780 cctld { include "cctld.conf"; }; |
108 | 781 html_tags { include "html-tags.conf"; }; |
782 html_limit off; | |
783 host_limit soft 20; | |
178 | 784 spamassassin 5; |
785 require_match yes; | |
786 dcc_greylist yes; | |
787 dcc_bulk_threshold 20; | |
108 | 788 }; |
94 | 789 |
216
784030ac71f1
Never whitelist self addressed mail. Changes for Fedora 10 and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents:
214
diff
changeset
|
790 generic "^dsl.static.*ttnet.net.tr$|(^|[x.-])(ppp|h|host)?([0-9]{1,3}[x.-](Red-|dynamic[x.-])?){4}" |
171 | 791 "your mail server %s seems to have a generic name"; |
792 | |
233
5c3e9bf45bb5
Add whitelisting by regex expression filtering.
Carl Byington <carl@five-ten-sg.com>
parents:
216
diff
changeset
|
793 white_regex ".*=example.com=user@yourhostingaccount.com"; |
5c3e9bf45bb5
Add whitelisting by regex expression filtering.
Carl Byington <carl@five-ten-sg.com>
parents:
216
diff
changeset
|
794 |
108 | 795 env_to { |
171 | 796 # !! replace this with your domain names |
108 | 797 # child contexts are not allowed to specify recipient addresses outside these domains |
179 | 798 # if this is a backup-mx, you need to include here domains for which you relay to the primary mx |
174 | 799 include "/etc/mail/local-host-names"; |
108 | 800 }; |
94 | 801 |
108 | 802 context whitelist { |
803 content off {}; | |
804 env_to { | |
171 | 805 # dcc_to ok { include "/var/dcc/whitecommon"; }; |
108 | 806 }; |
807 env_from white {}; # white forces all unmatched from addresses (everyone in this case) to be whitelisted | |
808 # so all mail TO these env_to addresses is accepted | |
809 }; | |
94 | 810 |
171 | 811 context abuse { |
812 dnsbl_list xbl; | |
813 content off {}; | |
174 | 814 generic "^$ " " "; # regex cannot match, to disable generic rdns rejects |
171 | 815 env_to { |
816 abuse@ # no content filtering on abuse reports | |
817 postmaster@ # "" | |
818 }; | |
819 env_from unknown {}; # ignore all parent white/black listing | |
820 }; | |
821 | |
108 | 822 context minimal { |
171 | 823 dnsbl_list sbl; |
178 | 824 content on { |
825 spamassassin 10; | |
826 dcc_bulk_threshold many; | |
827 }; | |
171 | 828 generic "^$ " " "; # regex cannot match, to disable generic rdns rejects |
108 | 829 env_to { |
830 }; | |
831 }; | |
94 | 832 |
108 | 833 context blacklist { |
255
d6d5c50b9278
Allow dnswl_list and dnsbl_list to be empty, to override lists specified in the ancestor contexts. Add daily recipient limits as a multiple of the hourly limits.
Carl Byington <carl@five-ten-sg.com>
parents:
253
diff
changeset
|
834 dnsbl_list ; |
d6d5c50b9278
Allow dnswl_list and dnsbl_list to be empty, to override lists specified in the ancestor contexts. Add daily recipient limits as a multiple of the hourly limits.
Carl Byington <carl@five-ten-sg.com>
parents:
253
diff
changeset
|
835 dnswl_list ; |
108 | 836 env_to { |
171 | 837 # dcc_to many { include "/var/dcc/whitecommon"; }; |
108 | 838 }; |
839 env_from black {}; # black forces all unmatched from addresses (everyone in this case) to be blacklisted | |
840 # so all mail TO these env_to addresses is rejected | |
841 }; | |
94 | 842 |
171 | 843 env_from unknown { |
844 abuse@ abuse; # replies to abuse reports use the abuse context | |
845 # dcc_from { include "/var/dcc/whitecommon"; }; | |
108 | 846 }; |
847 | |
171 | 848 autowhite 90 "autowhite/my-auto-whitelist"; |
849 # install should create /etc/dnsbl/autowhite writable by userid dnsbl | |
108 | 850 };]]></literallayout> |
851 </refsect1> | |
94 | 852 |
111 | 853 <refsect1 id='version.5'> |
201
752d4315675c
add reference to mercurial repository in the documentation
Carl Byington <carl@five-ten-sg.com>
parents:
187
diff
changeset
|
854 <title>Version</title> |
108 | 855 <para> |
201
752d4315675c
add reference to mercurial repository in the documentation
Carl Byington <carl@five-ten-sg.com>
parents:
187
diff
changeset
|
856 @VERSION@ |
108 | 857 </para> |
858 </refsect1> | |
859 | |
860 </refentry> | |
861 </reference> |