1#!/bin/sh
2
3# Format: input form:output form:query:expected result:expected extension
4# The last fields are optional.
5
6echo ==== no search string extension
7maps inline:{plain1@1.example=plain2@2.example,{"aa bb"@cc.example="dd ee"@dd.example}}
8test internal:external:external:default:plain1@1.example:plain2@2.example
9test internal:external:external:default:aa bb@cc.example:"dd ee"@dd.example
10test external:external:external:default:"aa bb"@cc.example:"dd ee"@dd.example
11test external:external:internal:default:"aa bb"@cc.example:dd ee@dd.example
12test internal:internal:external:default:plain1@1.example:plain2@2.example
13test internal:internal:external:default:aa bb@cc.example
14test internal:internal:external:default:"aa bb"@cc.example:"dd ee"@dd.example
15
16echo ==== with search string extension
17maps inline:{plain1@1.example=plain2@2.example,{"aa bb"@cc.example="dd ee"@dd.example}}
18test internal:external:external:default:plain1+ext@1.example:plain2@2.example:+ext
19test internal:external:external:default:aa bb+ax bx@cc.example:"dd ee"@dd.example:+ax bx
20test external:external:external:default:"aa bb+ax bx"@cc.example:"dd ee"@dd.example:+ax bx
21test external:external:internal:default:"aa bb+ax bx"@cc.example:dd ee@dd.example:+ax bx
22test internal:internal:external:default:plain1+ext@1.example:plain2@2.example:+ext
23test internal:internal:external:default:"aa bb+ax bx"@cc.example
24test internal:internal:external:default:"aa bb"+ax bx@cc.example:"dd ee"@dd.example:+ax bx
25
26echo ==== at in localpart
27maps inline:{"a@b"=foo@example,"a.b."=bar@example}
28test external:external:external:default:"a@b"@localhost.localdomain:foo@example
29test external:external:external:default:"a@b+ext"@localhost.localdomain:foo@example:+ext
30test external:external:external:default:"a.b."@localhost.localdomain:bar@example
31
32echo ==== legacy support
33maps inline:{"a@b"=extern-1@example,a@b=intern-1@example,a.b.=intern-2@example}
34test internal:external-first:external:default:a@b@localhost.localdomain:extern-1@example
35test internal:external-first:external:default:a.b.@localhost.localdomain:intern-2@example
36
37echo ==== at_domain test
38maps inline:{plain1@1.example=plain2@2.example,@3.example=plain4@4.example,plain5@3.example=plain6@6.example}
39test external:external:external:default:plain1+ext@1.example:plain2@2.example:+ext
40test external:external:external:default:plain2@2.example:
41test external:external:external:default:plain3@3.example:plain4@4.example
42test external:external:external:default:plain5@3.example:plain6@6.example
43
44echo ==== domain test
45maps inline:{plain1@1.example=plain2@2.example,3.example=plain4@4.example,plain5@3.example=plain6@6.example}
46test external:external:external:full|noext|domain:plain1+ext@1.example:plain2@2.example:+ext
47test external:external:external:full|noext|domain:plain2@2.example:
48test external:external:external:full|noext|domain:plain3@3.example:plain4@4.example
49test external:external:external:full|noext|domain:plain5@3.example:plain6@6.example
50
51echo ==== at_domain for local domain
52maps inline:{ab=foo@example,@localhost.localdomain=@bar.example}
53test external:external:external:default:ab@localhost.localdomain:foo@example:
54test external:external:external:default:cd@localhost.localdomain:@bar.example
55
56echo ==== localpart_at_if_local and domain test
57maps inline:{ab@=foo@example,localhost.localdomain=@bar.example}
58test internal:external:external:localpart_at_if_local|domain:ab@localhost.localdomain:foo@example:
59test internal:external:external:localpart_at_if_local|noext|domain:ab+ext@localhost.localdomain:foo@example:+ext
60test internal:external:external:localpart_at_if_local|domain:cd@localhost.localdomain:@bar.example
61
62echo ==== localpart_at has less precedence than domain test
63maps inline:{ab@=foo@example,localhost.localdomain=@bar.example}
64test external:external:external:localpart_at|domain:ab@localhost.localdomain:@bar.example:
65test external:external:external:localpart_at|domain:ab@foo:foo@example
66
67echo ==== domain and subdomain test
68maps inline:{example=example-result,.example=dot-example-result}
69test external:external:external:domain:plain1+ext@1.example
70test external:external:external:domain:foo@sub.example
71test external:external:external:domain:foo@example:example-result
72test external:external:external:domain|pdms:foo@example:example-result
73test external:external:external:domain|pdms:foo@sub.example:example-result
74test external:external:external:domain|pdms:foo@sub.sub.example:example-result
75test external:external:external:domain|pddms:foo@example:example-result
76test external:external:external:domain|pddms:foo@sub.example:dot-example-result
77test external:external:external:domain|pddms:foo@sub.sub.example:dot-example-result
78