require "vnd.stalwart.testsuite"; require "duplicate"; test_set "message" text: From: sirius@example.org To: nico@frop.example.com Subject: Frop! Message-ID: X-Frop: Frop! . ; test "Without duplicates" { if duplicate { test_fail "test erroneously reported a duplicate"; } if duplicate :handle "handle" { test_fail "test with :handle erroneously reported a duplicate"; } if duplicate { test_fail "test erroneously reported a duplicate"; } if duplicate :handle "handle" { test_fail "test with :handle erroneously reported a duplicate"; } if duplicate :header "X-frop" { test_fail "test with :header erroneously reported a duplicate"; } if duplicate :uniqueid "FROP!" { test_fail "test with :uniqueid erroneously reported a duplicate"; } if duplicate :seconds 90 { test_fail "test with :seconds erroneously reported a duplicate"; } if duplicate :seconds 90 :last { test_fail "test with :seconds :last erroneously reported a duplicate"; } if duplicate :last { test_fail "test with :seconds :last erroneously reported a duplicate"; } } test "With duplicates" { test_config_set "sieve_duplicated_id" "abc@hostname"; test_config_set "sieve_duplicated_id" "handleabc@hostname"; test_config_set "sieve_duplicated_id" "xyz@hostname"; test_config_set "sieve_duplicated_id" "handlexyz@hostname"; test_config_set "sieve_duplicated_id" "FROP!"; if not duplicate { test_fail "test did not report a duplicate"; } if not duplicate :handle "handle" { test_fail "test with :handle did not report a duplicate"; } if not duplicate { test_fail "test did not report a duplicate"; } if not duplicate :handle "handle" { test_fail "test with :handle did not report a duplicate"; } if not duplicate :header "X-frop" { test_fail "test with :header did not report a duplicate"; } if not duplicate :uniqueid "FROP!" { test_fail "test with :uniqueid did not report a duplicate"; } if not duplicate :seconds 90 { test_fail "test with :seconds did not report a duplicate"; } if not duplicate :seconds 90 :last { test_fail "test with :seconds :last did not report a duplicate"; } if not duplicate :last { test_fail "test with :seconds :last did not report a duplicate"; } }