From ddf3e587c41536baad71de4008eafd64b8c00d58 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Mon, 29 Sep 2008 22:25:06 +0200 Subject: [PATCH] Add test data. Signed-off-by: Florent Bruneau --- example/postlicyd.conf | 5 +-- postlicyd/data/test.conf | 63 +++++++++++++++++++++++++++++++++ postlicyd/data/test_emails_1 | 3 ++ postlicyd/data/test_emails_2 | 3 ++ postlicyd/data/test_emails_3 | 3 ++ postlicyd/data/test_hostnames_1 | 4 +++ postlicyd/data/test_hostnames_2 | 4 +++ postlicyd/data/test_hostnames_3 | 4 +++ postlicyd/data/testcase_1 | 4 +++ 9 files changed, 91 insertions(+), 2 deletions(-) create mode 100644 postlicyd/data/test_emails_1 create mode 100644 postlicyd/data/test_emails_2 create mode 100644 postlicyd/data/test_emails_3 create mode 100644 postlicyd/data/test_hostnames_1 create mode 100644 postlicyd/data/test_hostnames_2 create mode 100644 postlicyd/data/test_hostnames_3 diff --git a/example/postlicyd.conf b/example/postlicyd.conf index 0fc5953..d70a771 100644 --- a/example/postlicyd.conf +++ b/example/postlicyd.conf @@ -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 diff --git a/postlicyd/data/test.conf b/postlicyd/data/test.conf index 5f47d71..7fe9548 100644 --- a/postlicyd/data/test.conf +++ b/postlicyd/data/test.conf @@ -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 index 0000000..2f0fd50 --- /dev/null +++ b/postlicyd/data/test_emails_1 @@ -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 index 0000000..7a2eeda --- /dev/null +++ b/postlicyd/data/test_emails_2 @@ -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 index 0000000..353c013 --- /dev/null +++ b/postlicyd/data/test_emails_3 @@ -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 index 0000000..9d59ab3 --- /dev/null +++ b/postlicyd/data/test_hostnames_1 @@ -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 index 0000000..5d9e2a4 --- /dev/null +++ b/postlicyd/data/test_hostnames_2 @@ -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 index 0000000..49893ac --- /dev/null +++ b/postlicyd/data/test_hostnames_3 @@ -0,0 +1,4 @@ +example.net +foobar.example.net +test.foobar.example.net +foo.example.net diff --git a/postlicyd/data/testcase_1 b/postlicyd/data/testcase_1 index 2541656..32d54b3 100644 --- a/postlicyd/data/testcase_1 +++ b/postlicyd/data/testcase_1 @@ -24,3 +24,7 @@ etrn_domain= stress= filter1=match +filter2=fail +filter3=fail +filter4=fail +filter5=fail -- 2.20.1