2 Module: Test_Postfix_Transport
3 Provides unit tests and examples for the <Postfix_Transport> lens.
6 module Test_Postfix_Transport =
9 let conf = "# a comment
10 the.backed-up.domain.tld relay:[their.mail.host.tld]
12 * smtp:outbound-relay.my.domain
13 example.com uucp:example
15 example.com :[gateway.example.com]
18 firstname_lastname@example.com discard:
19 .example.com error:mail for *.example.com is not deliverable
22 (* Test: Postfix_Transport.lns *)
23 test Postfix_Transport.lns get conf =
24 { "#comment" = "a comment" }
25 { "pattern" = "the.backed-up.domain.tld"
26 { "transport" = "relay" }
27 { "nexthop" = "[their.mail.host.tld]" } }
28 { "pattern" = ".my.domain"
32 { "transport" = "smtp" }
33 { "nexthop" = "outbound-relay.my.domain" } }
34 { "pattern" = "example.com"
35 { "transport" = "uucp" }
36 { "nexthop" = "example" } }
37 { "pattern" = "example.com"
38 { "transport" = "slow" }
40 { "pattern" = "example.com"
42 { "nexthop" = "[gateway.example.com]" } }
43 { "pattern" = "user.foo@example.com"
44 { "transport" = "smtp" }
45 { "nexthop" = "bar.example:2025" } }
46 { "pattern" = "firstname_lastname@example.com"
47 { "transport" = "discard" }
49 { "pattern" = ".example.com"
50 { "transport" = "error" }
51 { "nexthop" = "mail for *.example.com is not deliverable" } }
53 (* Test: Postfix_Transport.lns
55 test Postfix_Transport.lns get "user@example.com [12.34.56.78]:587\n" =
56 { "pattern" = "user@example.com"
57 { "host" = "[12.34.56.78]" }