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