1 # POSTLICYD configuration
3 # Postlicyd configuration contains:
4 # - a set of filter definition
5 # - the entry point in the filters for each smtp states
7 # The configuration format use 2 types of data:
8 # Token: [[:alpha:]]([[:alnum:]_]*)
9 # String: string format is a bit more complex. It can be one of the two following
11 # - C-like strings "[^\n\r]*". In this kind of string, the \ character is used to
12 # escape any character \c = c (\n = n, \\ = \, ...). This format allow non-ascii
13 # strings and string concatenation " abcd " "ef" = " abcd ef".
14 # - ASCII-only strings can be written without double-quotes. They can be splitted
15 # into several lines using shell-like escaping of EOL. A string begins and ends on
16 # on a non-blank character. This king of string can not contain semi-colons.
18 # The following format are equivalent:
22 # (2) "this is a string"
27 # Most of the configuration use a format:
30 # When not in a string, spaces and line breaks are ignored. You can use comments
31 # everywhere out of a string. It starts with a '#' character and ends at the end of the
32 # line. Comments are strictly equivalents to white spaces.
36 # A definition of a filter contains:
37 # - the name of the filter. This name MUST be uniq (non-uniq names can lead to undefined
40 # - a list of type-specific parameters
41 # - a list of hooks (on_hookname)
44 # A filter can returns different values. Each return value is given a name. The
45 # configuration associates an action to run to a return value name.
47 # The action can be either a postfix access(5) value or a filter name. Postfix access
48 # parameters must be prefixed by 'postfix:'.
51 # on_match = postfix:REJECT Blacklisted;
54 # Current defined filter types are:
55 # - iplist: match the client_address against one or more blacklist files from a rbl
57 # - file: (non)?lock:weight:filename
58 # declare a file to load. If lock is given, the klist is locked into the
59 # RAM. The weight is a number giving the weight of this blaclist file in the
61 # - soft_threshold: score (default: 1)
62 # minimum score to match the soft_match return value
63 # - hard_threshold: score (default: 1)
64 # minimum score to match the hard_match return value
66 # The score of a query is the sum of the weight of the blacklist it matched.
67 # - If the IP can not be parsed, returns error
68 # - If the score is strictly greater >= than hard_threshold, returns hard_match
69 # - If the score is strictly greater >= than soft_threshold, returns soft_match
70 # - Else, returns fail
72 # - strlist: match strings from the query against a list of list.
74 # - file: (non)?lock:(pre|suf)fix:weight:filename
75 # declare a file to load. If lock is given, the list is locked into the
76 # RAM. Prefix/Suffix is a parameter to tell the matcher which is the most
77 # efficient storage order. The strings are internally stored into a trie that
78 # allow high compression if a lot of prefix are shared by several strings. If
79 # you choose "prefix", string are stored in the natural order in memory and
80 # prefix compression is performed. If you choose "suffix", strings are stored
81 # in reverse order in memory and suffix compression is performed. The weight
82 # is a number giving the weight of this list in the string score.
83 # - soft_threshold: score (default: 1)
84 # minimum score to match the soft_match return value
85 # - hard_threshold: score (default: 1)
86 # minimum score to match the hard_match return value
87 # - fields: field_name(,field_name)*
88 # list of field the match the string against.
89 # currently only email OR hostname fields are supported. You MUST choose only
90 # one of these types per strlist, and be carefull that the field you requested
91 # are available in the protocol state you want to use this filter for.
92 # * hostname fields: helo_name, client_name, reverse_client_name
93 # * email fields: sender, recipient
95 # The score of a query is the sum of the weight of the list it matched.
96 # - If the score is strictly greater >= than hard_threshold, returns hard_match
97 # - If the score is strictly greater >= than soft_threshold, returns soft_match
98 # - Else, returns fail
100 # - to match helo_name, you must be on HELO state or later
101 # (stmpd_helo_restrictions)
102 # - to match sender, you must be on MAIL state or later
103 # (smtpd_sender_restrictions)
104 # - to match recipient, you must on RCPT state (stmpd_recipient_restrictions)
105 # - client_name and reverse_client_name are always available
107 # - greylist: greylister
109 # - path: /my/path/ (required)
110 # path where to store the greylist database
111 # - prefix: name (default: "")
112 # prefix to the name of the greylist database
113 # - lookup_by_host: boolean (default: false)
114 # perform lookup per host instead of domain.
115 # - delay: number (default: 300)
116 # number of seconds the client must wait before retrial.
117 # - retry_window: (default: 2 * 24 * 3600)
118 # number of seconds we wait for a retry.
119 # - client_awl: number (default: 5)
120 # number of successful greylisting before the client get whitelisted (0 means,
121 # no-auto-whitelist).
123 # - if the client is whitelisted, returns whitelist
124 # - if the client is greylisted, returns greylist
125 # - if a error occured (not currently possible), returns error
127 # this filter is a recipient filter and works in RCPT state only
128 # (smtpd_recipient_restrictions).
131 # A filter look likes that:
135 # param1 = parameter value 1;
137 # on_action1 = action;
141 # Perform greylisting
146 path = /var/spool/postlicyd/;
150 on_greylist = postfix:DEFER_IF_PERMIT optional text;
151 on_whitelist = postfix:OK;
156 spamhaus_and_abuseat {
160 file = lock:10:/var/spool/postlicyd/rbl.spamhaus.org;
161 file = lock:1:/var/spool/postlicyd/cbl.abuseat.org;
166 on_soft_match = greylist;
167 on_hard_match = postfix:REJECT optional text;
168 on_fail = postfix:OK;
169 on_error = postfix:DUNNO;
173 # Whitelist some clients
178 file = lock:1:/var/spool/postlicyd/client_whitelist;
179 fields = client_name;
182 on_hard_match = postfix:OK;
183 on_fail = spamhaus_and_abuseat;
189 # Access policy daemon can be used at several protocol states. For each of this states,
190 # you can define a different entry point in the filtering tree. This entry points have
191 # the following format:
193 # state = filter_name;
195 # The filter_name MUST be one of the filter you previously defined.
197 # The available states are:
198 # - client_filter: called on CONNECT state (smtpd_client_restrictions)
199 # - helo_filter (or ehlo_filter): called on HELO/EHLO command (smtpd_helo_restrictions)
200 # - sender_filter: called on the MAIL FROM command (stmpd_sender_restrictions)
201 # - recipient_filter: called on the RCPT TO command (smtpd_recipient_restrictions)
202 # - data_filter: called on the DATA command (smtpd_data_restrictions)
203 # - end_of_data_filter: called on the END-OF-DATA command
204 # (smtpd_end_of_data_restrictions)
205 # - etrn_filter: called on the ETRN command (stmpd_etrn_restrictions)
206 # - verify_filter: called on the VRFY command (no postfix hook ?)
208 recipient_filter = client_whitelist;
210 # vim:set syntax=conf: