+# - counter: trig actions depending on the value of a counter
+# Parameters:
+# - counter: the id of the counter to trig on (0 -> 63)
+# - hard_threshold: minimum counter value to trig the hard_match hook
+# - soft_threshold: minimum counter value to trig the soft_match hook
+# Return value:
+# - hard_match if the counter with the given id is greater or equal to hard_threshold
+# - soft_match if the counter value is between soft_threshold and hard_threshold
+# - fail if the counter value is below soft_match
+
+# match if the counter 0 value is greater than 8, or between 5 and 7
+counter {
+ type = counter;
+
+ # configuration
+ counter = 0;
+ hard_threshold = 8;
+ soft_threshold = 5;
+
+ # hook
+ on_hard_match = postfix:REJECT ${sender_domain};
+ on_soft_match = greylist;
+ on_fail = counter:1:10:match;
+}
+