94
|
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}+ "}"
|
95
|
11 # STATEMENT = (DNSBL | DNSBLLIST | CONTENT | ENV-TO | VERIFY | CONTEXT | ENV-FROM) ";"
|
94
|
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
|
95
|
33 # VERIFY = "verify" HOSTNAME ";"
|
|
34
|
94
|
35 # ENV_FROM = "env_from" [DEFAULT] "{" {(FROM-ADDR | DCC-FROM)}+ "}"
|
|
36 # FROM-ADDR = ADDRESS VALUE [";"]
|
|
37 # DCC-FROM = "dcc_from" "{" DCCINCLUDEFILE "}" ";"
|
|
38 # DEFAULT = ("white" | "black" | "unknown" | "inherit" | "")
|
|
39 # ADDRESS = (USER@ | DOMAIN | USER@DOMAIN)
|
|
40 # VALUE = ("white" | "black" | "unknown" | CHILD-CONTEXT-NAME)
|
|
41
|
|
42
|
|
43 context sample {
|
|
44 dnsbl local blackholes.five-ten-sg.com "Mail from %s rejected - local; see http://www.five-ten-sg.com/blackhole.php?%s";
|
|
45 dnsbl sbl sbl-xbl.spamhaus.org "Mail from %s rejected - sbl; see http://www.spamhaus.org/query/bl?ip=%s";
|
|
46 dnsbl xbl xbl.spamhaus.org "Mail from %s rejected - xbl; see http://www.spamhaus.org/query/bl?ip=%s";
|
|
47 dnsbl dul dul.dnsbl.sorbs.net "Mail from %s rejected - dul; see http://www.sorbs.net/lookup.shtml?%s";
|
|
48 dnsbl_list local sbl dul;
|
|
49
|
|
50 content on {
|
|
51 filter sbl-xbl.spamhaus.org "Mail containing %s rejected - sbl; see http://www.spamhaus.org/query/bl?ip=%s";
|
|
52 ignore { include "hosts-ignore.conf"; };
|
|
53 tld { include "tld.conf"; };
|
|
54 html_tags { include "html-tags.conf"; };
|
|
55 html_limit on 20 "Mail containing excessive bad html tags rejected";
|
|
56 html_limit off;
|
|
57 host_limit on 20 "Mail containing excessive host names rejected";
|
|
58 host_limit soft 20;
|
|
59 };
|
|
60
|
|
61 env_to {
|
|
62 mydomain.com; # child contexts are not allowed to specify recipient addresses outside these domains
|
|
63 customer1.com;
|
|
64 customer1a.com;
|
|
65 customer1b.com;
|
|
66 customer2.com;
|
|
67 customer2a.com;
|
|
68 customer2b.com;
|
|
69 };
|
|
70
|
|
71 context whitelist {
|
|
72 content off {};
|
|
73 env_to {
|
|
74 # dcc_to ok { include "/var/dcc/whitecommon"; }; # copy the dcc OK values (env_to) into this context
|
|
75 };
|
|
76 env_from white {}; # white forces all unmatched from addresses (everyone in this case) to be whitelisted
|
|
77 # so all mail TO these env_to addresses is accepted
|
|
78 };
|
|
79
|
|
80 context abuse {
|
|
81 dnsbl_list xbl;
|
|
82 content off {};
|
|
83 env_to {
|
|
84 abuse@; # no content filtering on abuse reports
|
|
85 postmaster@; # ""
|
|
86 };
|
|
87 env_from unknown {}; # ignore all parent white/black listing
|
|
88 };
|
|
89
|
|
90 context minimal {
|
|
91 dnsbl_list sbl dul;
|
|
92 content on {};
|
|
93 env_to {
|
|
94 sales@mydomain.com;
|
|
95 };
|
|
96 };
|
|
97
|
|
98 context blacklist {
|
|
99 env_to {
|
|
100 dcc_to many { include "/var/dcc/whitecommon"; }; # copy the dcc MANY values (env_to) into this context
|
|
101 old-employee@mydomain.com;
|
|
102 };
|
|
103 env_from black {}; # black forces all unmatched from addresses (everyone in this case) to be blacklisted
|
|
104 # so all mail TO these env_to addresses is rejected
|
|
105 };
|
|
106
|
|
107 context vp { # special context for the vp
|
|
108 env_to {
|
|
109 vp@mydomain.com;
|
|
110 };
|
|
111 env_from inherit {
|
|
112 nai.com black; # the vp does not like nai
|
|
113 yahoo.com unknown; # override parent context blacklisting
|
|
114 mother@spammyisp.com white; # suppress dnsbl checking
|
|
115 };
|
|
116 };
|
|
117
|
|
118 context customer1 {
|
|
119 dnsbl_list sbl dul;
|
|
120 env_to {
|
|
121 customer1.com;
|
|
122 customer1a.com;
|
|
123 customer1b.com;
|
|
124 };
|
|
125
|
|
126 verify mail.customer1.com;
|
|
127
|
|
128 context customer1a {
|
|
129 env_to {
|
|
130 customer1a.com;
|
|
131 }
|
|
132 env_from black { # blacklist everything
|
|
133 first@acceptable.com unknown; # except these specific envelope senders
|
|
134 second@another.com unknown;
|
|
135 yahoo.com inherit; # delegate to the parent
|
|
136 };
|
|
137 };
|
|
138
|
|
139 env_from { # default value of the default is inherit
|
|
140 yahoo.com black; # no mail from yahoo
|
|
141 first@yahoo.com unknown; # except this one
|
|
142 };
|
|
143 };
|
|
144
|
|
145 context customer2 {
|
|
146 dnsbl_list sbl;
|
|
147 env_to {
|
|
148 customer2.com;
|
|
149 customer2a.com;
|
|
150 customer2b.com;
|
|
151 };
|
|
152 };
|
|
153
|
|
154 env_from unknown {
|
|
155 dcc_from { include "/var/dcc/whitecommon"; }; # copy the dcc OK/MANY values (env_from, substitute mail_host) into this context
|
|
156 abuse@ abuse; # replies to abuse reports use the abuse context
|
|
157 yahoo.com black; # don't take mail from yahoo
|
|
158 spammer@example.com black;
|
|
159 };
|
|
160 };
|
|
161
|