E-mail aliases
[hcoop/domtool2.git] / tests / domain2.dtl
1 extern type domain;
2 extern val domain : domain -> Domain => [Root];
3
4 extern type emailUser;
5 extern type email;
6
7 extern type aliasSource;
8 extern val userSource : emailUser -> aliasSource;
9 extern val defaultSource : aliasSource;
10 extern val catchAllSource : aliasSource;
11
12 extern type aliasTarget;
13 extern val addressTarget : email -> aliasTarget;
14 extern val addressesTarget : [email] -> aliasTarget;
15 extern val dropTarget : aliasTarget;
16
17 extern val aliasPrim : aliasSource -> aliasTarget -> [Domain];
18
19 val alias = \user -> \email -> aliasPrim (userSource user) (addressTarget email);
20 val aliasMulti = \user -> \emails -> aliasPrim (userSource user) (addressesTarget emails);
21 val aliasDrop = \user -> aliasPrim (userSource user) dropTarget;
22
23 val defaultAlias = \email -> aliasPrim defaultSource (addressTarget email);
24 val catchAllAlias = \email -> aliasPrim catchAllSource (addressTarget email);
25
26 domain "hcoop.net" with
27 alias "schmeppo" "dlonker";
28 aliasMulti "me" ["nowhere","smelly@yikes"];
29 aliasDrop "yippo";
30
31 defaultAlias "billy";
32 catchAllAlias "bonkers"
33 end