Add test data.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Mon, 29 Sep 2008 20:25:06 +0000 (22:25 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Mon, 29 Sep 2008 20:25:06 +0000 (22:25 +0200)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
example/postlicyd.conf
postlicyd/data/test.conf
postlicyd/data/test_emails_1 [new file with mode: 0644]
postlicyd/data/test_emails_2 [new file with mode: 0644]
postlicyd/data/test_emails_3 [new file with mode: 0644]
postlicyd/data/test_hostnames_1 [new file with mode: 0644]
postlicyd/data/test_hostnames_2 [new file with mode: 0644]
postlicyd/data/test_hostnames_3 [new file with mode: 0644]
postlicyd/data/testcase_1

index 0fc5953..d70a771 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
index 5f47d71..7fe9548 100644 (file)
@@ -6,5 +6,68 @@ filter1 {
   on_fail   = postfix:OK;
 }
 
+filter2 {
+  type = strlist;
+
+  fields = helo_name,client_name;
+  file   = nolock:suffix:1:data/test_hostnames_1;
+  file   = nolock:prefix:4:data/test_hostnames_2;
+  file   = nolock:suffix:8:data/test_hostnames_3;
+
+  soft_threshold = 1;
+  hard_threshold = 5;
+
+  on_hard_match = postfix:OK;
+  on_soft_match = postfix:OK;
+  on_fail = postfix:OK;
+}
+
+filter3 {
+  type = strlist;
+
+  fields = helo_name,client_name,reverse_client_name;
+  file   = nolock:suffix:1:data/test_hostnames_1;
+  file   = nolock:prefix:4:data/test_hostnames_2;
+  file   = nolock:suffix:8:data/test_hostnames_3;
+
+  soft_threshold = 1;
+  hard_threshold = 5;
+
+  on_hard_match = postfix:OK;
+  on_soft_match = postfix:OK;
+  on_fail = postfix:OK;
+}
+
+filter4 {
+  type = strlist;
+
+  fields = sender;
+  file   = nolock:suffix:1:data/test_emails_1;
+  file   = nolock:prefix:4:data/test_emails_2;
+  file   = nolock:suffix:8:data/test_emails_3;
+
+  soft_threshold = 1;
+  hard_threshold = 5;
+
+  on_hard_match = postfix:ok;
+  on_soft_match = postfix:ok;
+  on_fail = postfix:ok;
+}
+
+filter5 {
+  type = strlist;
+
+  fields = sender,recipient;
+  file   = nolock:suffix:1:data/test_emails_1;
+  file   = nolock:prefix:4:data/test_emails_2;
+  file   = nolock:suffix:8:data/test_emails_3;
+
+  soft_threshold = 1;
+  hard_threshold = 5;
+
+  on_hard_match = postfix:ok;
+  on_soft_match = postfix:ok;
+  on_fail = postfix:ok;
+}
 
 recipient_filter = filter1;
diff --git a/postlicyd/data/test_emails_1 b/postlicyd/data/test_emails_1
new file mode 100644 (file)
index 0000000..2f0fd50
--- /dev/null
@@ -0,0 +1,3 @@
+contact@example.com
+postmaster@example.com
+test@foo.example.com
diff --git a/postlicyd/data/test_emails_2 b/postlicyd/data/test_emails_2
new file mode 100644 (file)
index 0000000..7a2eeda
--- /dev/null
@@ -0,0 +1,3 @@
+contact@example.org
+postmaster@example.org
+test@foo.example.org
diff --git a/postlicyd/data/test_emails_3 b/postlicyd/data/test_emails_3
new file mode 100644 (file)
index 0000000..353c013
--- /dev/null
@@ -0,0 +1,3 @@
+contact@example.net
+postmaster@example.net
+test@foo.example.net
diff --git a/postlicyd/data/test_hostnames_1 b/postlicyd/data/test_hostnames_1
new file mode 100644 (file)
index 0000000..9d59ab3
--- /dev/null
@@ -0,0 +1,4 @@
+example.com
+foobar.example.com
+test.foobar.example.com
+foo.example.com
diff --git a/postlicyd/data/test_hostnames_2 b/postlicyd/data/test_hostnames_2
new file mode 100644 (file)
index 0000000..5d9e2a4
--- /dev/null
@@ -0,0 +1,4 @@
+example.org
+foobar.example.org
+test.foobar.example.org
+foo.example.org
diff --git a/postlicyd/data/test_hostnames_3 b/postlicyd/data/test_hostnames_3
new file mode 100644 (file)
index 0000000..49893ac
--- /dev/null
@@ -0,0 +1,4 @@
+example.net
+foobar.example.net
+test.foobar.example.net
+foo.example.net
index 2541656..32d54b3 100644 (file)
@@ -24,3 +24,7 @@ etrn_domain=
 stress=
 
 filter1=match
+filter2=fail
+filter3=fail
+filter4=fail
+filter5=fail