Add doc about the new max_age parameter of the greylister.
[apps/pfixtools.git] / example / postlicyd.conf
index 1c2c6ba..fded2bd 100644 (file)
@@ -66,7 +66,7 @@
 #   Current defined filter types are:
 #     - iplist: match the client_address against one or more blacklist files from a rbl
 #        Parameters:
-#           - file: (non)?lock:weight:filename
+#           - file: (no)?lock:weight:filename
 #             declare a file to load. If lock is given, the klist is locked into the
 #             RAM. The weight is a number giving the weight of this blaclist file in the
 #             score of the IP
@@ -101,7 +101,7 @@ spamhaus_and_abuseat {
 
 #     - strlist: match strings from the query against a list of list.
 #        Parameters:
-#           - file: (non)?lock:(pre|suf)fix:weight:filename
+#           - file: (no)?lock:(pre|suf)fix:weight:filename
 #             declare a file to load. If lock is given, the list is locked into the
 #             RAM. Prefix/Suffix is a parameter to tell the matcher which is the most
 #             efficient storage order. The strings are internally stored into a trie that
@@ -121,6 +121,7 @@ spamhaus_and_abuseat {
 #             are available in the protocol state you want to use this filter for.
 #              * hostname fields: helo_name, client_name, reverse_client_name
 #              * email fields: sender, recipient
+#             No space is allowed in this parameter.
 #        Return value:
 #          The score of a query is the sum of the weight of the list it matched.
 #           - If the score is strictly greater >= than hard_threshold, returns hard_match
@@ -163,6 +164,9 @@ client_whitelist {
 #           - client_awl: number (default: 5)
 #             number of successful greylisting before the client get whitelisted (0 means,
 #             no-auto-whitelist).
+#           - max_age: number (default: 30 * 3600)
+#             lifetime of a greylist/whitelist session: ie, if a client does ne reappear during
+#             max_age seconds, the entries associated to this client are invalidated.
 #         Return value:
 #           - if the client is whitelisted, returns whitelist
 #           - if the client is greylisted, returns greylist
@@ -185,6 +189,49 @@ greylist {
 }
 
 
+#     - match: direct matching against the query fields
+#        Parameters:
+#           - match_all: boolean
+#             if true, the filter won't match until all conditions
+#             are verified. If false, the filter match on the first
+#             verified condition.
+#           - condition: field_name OP (value)
+#             * the field_name is one of the field name of the query
+#              emitted by postfix. This list with description of each
+#              field is available at:
+#               http://www.postfix.org/SMTPD_POLICY_README.html
+#             * OP is an operator. Available operators are:
+#                == field_name is strictly equal to value
+#                =i field_name is case insensitively equal to value
+#                != field_name is not equal to value
+#                !i field_name is not case insensitively equal to value
+#                >= field_name contains value
+#                >i field_name contains case insensitively value
+#                <= field_name is contained by value
+#                <i field_name is contained case insensitively by value
+#                #= field_name is empty or not set
+#                #i field_name is not empty
+#         Return value:
+#           - if the conditions are verified (according to match_all strategy), return match
+#           - if the conditions are not verified, return fail
+
+# match one of the condition: "stress mode activated", "client_name contains debian.org" or
+#                             "recipient is empty"
+match {
+  type = match;
+
+  # configuration
+  match_all = false;
+  condition = stress == yes;
+  condition = client_name >= debian.org;
+  condition = recipient #=;
+
+  # hook
+  on_match = postfix:OK;
+  on_fail = greylist;
+}
+
+
 # ENTRY POINTS
 #
 # Access policy daemon can be used at several protocol states. For each of this states,