Fix environment calculation rule for ELocal
[hcoop/domtool2.git] / lib / alias.dtl
CommitLineData
095de39e
AC
1{{E-mail aliases (AKA, redirects)}}
2
3extern type emailUser;
4{{A valid username to appear before the "@" in an e-mail address}}
5
6extern type email;
7{{A valid e-mail address.
8 It may also be a username only, in which case it is interpreted as a local
9 user's mailbox.}}
10
11extern type aliasSource;
12{{An e-mail recipient whose mail you want to redirect}}
13extern val userSource : emailUser -> aliasSource;
14{{The part appear before the "@" in your desired source address}}
15extern val defaultSource : aliasSource;
16{{Matches any mail to this domain that doesn't match any other rule, with the
17 exception of systemwide usernames like UNIX users.}}
18extern val catchAllSource : aliasSource;
19{{Matches any mail to this domain that doesn't match any other rule, even
20 for systemwide usernames.}}
21
22extern type aliasTarget;
23{{A place to redirect messages}}
24extern val addressTarget : email -> aliasTarget;
25{{Redirect to this e-mail address.}}
26extern val addressesTarget : [email] -> aliasTarget;
27{{Redirect to all of these addresses.}}
28extern val dropTarget : aliasTarget;
29{{Silently delete all mail to the associated source.}}
30
8c142ff5 31extern val aliasPrim : aliasSource -> aliasTarget -> [Domain] {MailNodes: [mail_node]};
e0b0abd2
AC
32{{Request redirection of all mail from the source to the target, specifying on
33 which nodes this redirection should be applied.}}
095de39e 34
d5754b53 35val emailAlias = \user -> \email -> aliasPrim (userSource user) (addressTarget email);
095de39e
AC
36{{Redirect mail for the user at the current domain to the e-mail address.}}
37val aliasMulti = \user -> \emails -> aliasPrim (userSource user) (addressesTarget emails);
38{{Redirect mail for the user at the current domain to all of the e-mail
39 addresses listed.}}
40val aliasDrop = \user -> aliasPrim (userSource user) dropTarget;
41{{Silently delete mail to the user at the current domain.}}
42
43val defaultAlias = \email -> aliasPrim defaultSource (addressTarget email);
44{{When a message to the current domain doesn't match any other alias, and it
d189ec0e 45 doesn't match any systemwide username, send it to this e-mail address.}}
095de39e
AC
46val catchAllAlias = \email -> aliasPrim catchAllSource (addressTarget email);
47{{When a message to the current domain doesn't match any other alias, send it
48 to this e-mail address, even if it matches a systemwide username.}}