summaryrefslogtreecommitdiffstats
path: root/src/global/mail_addr_find.in
blob: f4f2fe48f7af3ae9163b58e42b4bfefc494d6b99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/sh

# Format: input form:output form:query:expected result:expected extension
# The last fields are optional.

echo ==== no search string extension
maps inline:{plain1@1.example=plain2@2.example,{"aa bb"@cc.example="dd ee"@dd.example}}
test internal:external:external:default:plain1@1.example:plain2@2.example
test internal:external:external:default:aa bb@cc.example:"dd ee"@dd.example
test external:external:external:default:"aa bb"@cc.example:"dd ee"@dd.example
test external:external:internal:default:"aa bb"@cc.example:dd ee@dd.example
test internal:internal:external:default:plain1@1.example:plain2@2.example
test internal:internal:external:default:aa bb@cc.example
test internal:internal:external:default:"aa bb"@cc.example:"dd ee"@dd.example

echo ==== with search string extension
maps inline:{plain1@1.example=plain2@2.example,{"aa bb"@cc.example="dd ee"@dd.example}}
test internal:external:external:default:plain1+ext@1.example:plain2@2.example:+ext
test internal:external:external:default:aa bb+ax bx@cc.example:"dd ee"@dd.example:+ax bx
test external:external:external:default:"aa bb+ax bx"@cc.example:"dd ee"@dd.example:+ax bx
test external:external:internal:default:"aa bb+ax bx"@cc.example:dd ee@dd.example:+ax bx
test internal:internal:external:default:plain1+ext@1.example:plain2@2.example:+ext
test internal:internal:external:default:"aa bb+ax bx"@cc.example
test internal:internal:external:default:"aa bb"+ax bx@cc.example:"dd ee"@dd.example:+ax bx

echo ==== at in localpart
maps inline:{"a@b"=foo@example,"a.b."=bar@example}
test external:external:external:default:"a@b"@localhost.localdomain:foo@example
test external:external:external:default:"a@b+ext"@localhost.localdomain:foo@example:+ext
test external:external:external:default:"a.b."@localhost.localdomain:bar@example

echo ==== legacy support
maps inline:{"a@b"=extern-1@example,a@b=intern-1@example,a.b.=intern-2@example}
test internal:external-first:external:default:a@b@localhost.localdomain:extern-1@example
test internal:external-first:external:default:a.b.@localhost.localdomain:intern-2@example

echo ==== at_domain test
maps inline:{plain1@1.example=plain2@2.example,@3.example=plain4@4.example,plain5@3.example=plain6@6.example}
test external:external:external:default:plain1+ext@1.example:plain2@2.example:+ext
test external:external:external:default:plain2@2.example:
test external:external:external:default:plain3@3.example:plain4@4.example
test external:external:external:default:plain5@3.example:plain6@6.example

echo ==== domain test
maps inline:{plain1@1.example=plain2@2.example,3.example=plain4@4.example,plain5@3.example=plain6@6.example}
test external:external:external:full|noext|domain:plain1+ext@1.example:plain2@2.example:+ext
test external:external:external:full|noext|domain:plain2@2.example:
test external:external:external:full|noext|domain:plain3@3.example:plain4@4.example
test external:external:external:full|noext|domain:plain5@3.example:plain6@6.example

echo ==== at_domain for local domain
maps inline:{ab=foo@example,@localhost.localdomain=@bar.example}
test external:external:external:default:ab@localhost.localdomain:foo@example:
test external:external:external:default:cd@localhost.localdomain:@bar.example

echo ==== localpart_at_if_local and domain test
maps inline:{ab@=foo@example,localhost.localdomain=@bar.example}
test internal:external:external:localpart_at_if_local|domain:ab@localhost.localdomain:foo@example:
test internal:external:external:localpart_at_if_local|noext|domain:ab+ext@localhost.localdomain:foo@example:+ext
test internal:external:external:localpart_at_if_local|domain:cd@localhost.localdomain:@bar.example

echo ==== localpart_at has less precedence than domain test
maps inline:{ab@=foo@example,localhost.localdomain=@bar.example}
test external:external:external:localpart_at|domain:ab@localhost.localdomain:@bar.example:
test external:external:external:localpart_at|domain:ab@foo:foo@example

echo ==== domain and subdomain test
maps inline:{example=example-result,.example=dot-example-result}
test external:external:external:domain:plain1+ext@1.example
test external:external:external:domain:foo@sub.example
test external:external:external:domain:foo@example:example-result
test external:external:external:domain|pdms:foo@example:example-result
test external:external:external:domain|pdms:foo@sub.example:example-result
test external:external:external:domain|pdms:foo@sub.sub.example:example-result
test external:external:external:domain|pddms:foo@example:example-result
test external:external:external:domain|pddms:foo@sub.example:dot-example-result
test external:external:external:domain|pddms:foo@sub.sub.example:dot-example-result