annotate xml/sample.conf @ 75:1142e46be550

start coding on new config syntax
author carl
date Wed, 13 Jul 2005 23:04:14 -0700
parents 419e00901570
children 81f1e400e8ab
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4
15a7e942adec updates to use dcc conf files
carl
parents: 0
diff changeset
1 # $Id$
0
96a9758165cd Initial revision
carl
parents:
diff changeset
2 #
75
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
3
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
4 # partial bnf description of this configuration language
56
57607387263d updates for 3.6, better documentation on removing content filtering, missing some files in cvs
carl
parents: 54
diff changeset
5 #
75
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
6 # CONFIG = {CONTEXT ";"}+
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
7 # CONTEXT = "context" NAME "{" {STATEMENT}+ "}"
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
8 # STATEMENT = (DNSBL | DNSBLLIST | CONTENT | ENV-TO | CONTEXT | ENV-FROM) ";"
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
9
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
10 # DNSBL = "dnsbl" NAME DNSPREFIX ERROR-MSG
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
11
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
12 # DNSBLLIST = "dnsbl_list" {NAME}+
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
13
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
14 # CONTENT = "content" ("on" | "off") "{" {CONTENT-STATEMENT}+ "}"
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
15 # CONTENT-STATEMENT = (FILTER | IGNORE | TLD | HTML-TAGS | HTML-LIMIT | HOST-LIMIT) ";"
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
16 # FILTER = "filter" DNSPREFIX ERROR-MSG
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
17 # IGNORE = "ignore" "{" {HOSTNAME [";"]}+ "}"
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
18 # TLD = "tld" "{" {TLD [";"]}+ "}"
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
19 # HTML-TAGS = "html_tags" "{" {HTMLTAG [";"]}+ "}"
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
20 # ERROR-MSG = string containing exactly two %s replacement tokens for the client ip address
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
21
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
22 # HTML-LIMIT = "html_limit" ("on" INTEGER ERROR-MSG | "off")
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
23
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
24 # HOST-LIMIT = "host_limit" ("on" INTEGER ERROR-MSG | "off" | "soft" INTEGER)
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
25
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
26 # ENV-TO = "env_to" "{" {(TO-ADDR | DCC-TO)}+ "}"
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
27 # TO-ADDR = ADDRESS [";"]
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
28 # DCC-TO = "dcc_to" ("ok" | "many") "{" DCCINCLUDEFILE "}" ";"
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
29
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
30 # ENV_FROM = "env_from" DEFAULT "{" {(FROM-ADDR | DCC-FROM)}+ "}"
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
31 # FROM-ADDR = ADDRESS VALUE [";"]
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
32 # DCC-FROM = "dcc_from" "{" DCCINCLUDEFILE "}" ";"
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
33 # DEFAULT = ("white" | "black" | "unknown" | "inherit" | "")
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
34 # ADDRESS = (USER@ | DOMAIN | USER@DOMAIN)
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
35 # VALUE = ("white" | "black" | "unknown" | CHILD-CONTEXT-NAME
24
2e23b7184d2b start coding for bad html tag detection
carl
parents: 20
diff changeset
36
2e23b7184d2b start coding for bad html tag detection
carl
parents: 20
diff changeset
37
75
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
38 context sample {
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
39 dnsbl local blackholes.five-ten-sg.com "Mail from %s rejected - local; see http://www.five-ten-sg.com/blackhole.php?%s";
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
40 dnsbl spews blackholes.spews.org "Mail from %s rejected - spews; see http://www.spews.org/ask.cgi?x=%s";
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
41 dnsbl sbl sbl-xbl.spamhaus.org "Mail from %s rejected - sbl; see http://www.spamhaus.org/query/bl?ip=%s";
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
42 dnsbl xbl xbl.spamhaus.org "Mail from %s rejected - xbl; see http://www.spamhaus.org/query/bl?ip=%s";
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
43 dnsbl_list local sbl;
0
96a9758165cd Initial revision
carl
parents:
diff changeset
44
75
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
45 content on {
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
46 filter sbl-xbl.spamhaus.org "Mail containing %s rejected - sbl; see http://www.spamhaus.org/query/bl?ip=%s";
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
47 ignore { include "hosts-ignore.conf"; };
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
48 tld { include "tld.conf"; };
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
49 html_tags { include "html-tags.conf"; };
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
50 html_limit off;
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
51 host_limit on 20 "Mail containing excessive bad html tags rejected";
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
52 host_limit soft 20;
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
53 };
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
54
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
55 env_to {
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
56 mydomain.com; # child contexts are not allowed to specify recipient addresses outside these domains
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
57 customer1.com;
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
58 customer1a.com;
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
59 customer1b.com;
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
60 customer2.com;
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
61 customer2a.com;
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
62 customer2b.com;
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
63 };
0
96a9758165cd Initial revision
carl
parents:
diff changeset
64
75
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
65 context whitelist {
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
66 content off {};
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
67 env_to {
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
68 # dcc_to ok { include "/var/dcc/whitecommon"; };
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
69 };
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
70 env_from white {}; # white forces all unmatched from addresses (everyone in this case) to be whitelisted
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
71 # so all mail TO these env_to addresses is accepted
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
72 };
0
96a9758165cd Initial revision
carl
parents:
diff changeset
73
75
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
74 context abuse {
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
75 dnsbl_list xbl;
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
76 content off {};
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
77 env_to {
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
78 abuse@; # no content filtering on abuse reports
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
79 postmaster@; # ""
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
80 };
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
81 env_from unknown {}; # ignore all parent white/black listing
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
82 };
0
96a9758165cd Initial revision
carl
parents:
diff changeset
83
75
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
84 context minimal {
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
85 dnsbl_list sbl;
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
86 content on {};
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
87 env_to {
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
88 sales@mydomain.com;
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
89 };
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
90 };
0
96a9758165cd Initial revision
carl
parents:
diff changeset
91
75
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
92 context blacklist {
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
93 env_to {
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
94 dcc_to many { include "/var/dcc/whitecommon"; };
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
95 old-employee@mydomain.com;
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
96 };
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
97 env_from black {}; # black forces all unmatched from addresses (everyone in this case) to be blacklisted
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
98 # so all mail TO these env_to addresses is rejected
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
99 };
0
96a9758165cd Initial revision
carl
parents:
diff changeset
100
75
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
101 context vp { # special context for the vp
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
102 env_to {
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
103 vp@mydomain.com;
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
104 };
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
105 env_from inherit {
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
106 nai.com black; # the vp does not like nai
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
107 yahoo.com unknown; # override parent context blacklisting
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
108 mother@spammyisp.com white; # suppress dnsbl checking
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
109 };
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
110 };
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
111
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
112 context customer1 {
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
113 dnsbl_list sbl;
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
114 env_to {
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
115 customer1.com;
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
116 customer1a.com;
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
117 customer1b.com;
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
118 };
0
96a9758165cd Initial revision
carl
parents:
diff changeset
119
75
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
120 context customer1a {
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
121 env_to {
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
122 customer1a.com;
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
123 }
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
124 env_from black { # blacklist everything
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
125 first@acceptable.com unknown; # except these specific envelope senders
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
126 second@another.com unknown;
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
127 yahoo.com inherit; # delegate to the parent
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
128 };
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
129 };
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
130
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
131 env_from {
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
132 yahoo.com black; # no mail from yahoo
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
133 first@yahoo.com unknown; # except this one
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
134 };
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
135 };
0
96a9758165cd Initial revision
carl
parents:
diff changeset
136
75
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
137 context customer2 {
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
138 dnsbl_list sbl spews;
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
139 env_to {
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
140 customer2.com;
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
141 customer2a.com;
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
142 customer2b.com;
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
143 };
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
144 };
0
96a9758165cd Initial revision
carl
parents:
diff changeset
145
75
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
146 env_from unknown {
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
147 dcc_from { include "/var/dcc/whitecommon"; }; # use the dcc whitecommon list ok/many values to white/black list envelope from values here
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
148 abuse@ abuse; # replies to abuse reports use the abuse context
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
149 yahoo.com black; # don't take mail from yahoo
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
150 spammer@example.com black;
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
151 };
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
152 };
1142e46be550 start coding on new config syntax
carl
parents: 57
diff changeset
153