Commit | Line | Data |
---|---|---|
095de39e AC |
1 | {{E-mail aliases (AKA, redirects)}} |
2 | ||
3 | extern type emailUser; | |
4 | {{A valid username to appear before the "@" in an e-mail address}} | |
5 | ||
6 | extern 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 | ||
11 | extern type aliasSource; | |
12 | {{An e-mail recipient whose mail you want to redirect}} | |
13 | extern val userSource : emailUser -> aliasSource; | |
14 | {{The part appear before the "@" in your desired source address}} | |
15 | extern val defaultSource : aliasSource; | |
a356587a | 16 | {{Matches any mail to this domain that doesn't match any other rule.}} |
095de39e AC |
17 | |
18 | extern type aliasTarget; | |
19 | {{A place to redirect messages}} | |
20 | extern val addressTarget : email -> aliasTarget; | |
21 | {{Redirect to this e-mail address.}} | |
22 | extern val addressesTarget : [email] -> aliasTarget; | |
23 | {{Redirect to all of these addresses.}} | |
24 | extern val dropTarget : aliasTarget; | |
25 | {{Silently delete all mail to the associated source.}} | |
26 | ||
8c142ff5 | 27 | extern val aliasPrim : aliasSource -> aliasTarget -> [Domain] {MailNodes: [mail_node]}; |
e0b0abd2 AC |
28 | {{Request redirection of all mail from the source to the target, specifying on |
29 | which nodes this redirection should be applied.}} | |
095de39e | 30 | |
d5754b53 | 31 | val emailAlias = \user -> \email -> aliasPrim (userSource user) (addressTarget email); |
095de39e AC |
32 | {{Redirect mail for the user at the current domain to the e-mail address.}} |
33 | val aliasMulti = \user -> \emails -> aliasPrim (userSource user) (addressesTarget emails); | |
34 | {{Redirect mail for the user at the current domain to all of the e-mail | |
35 | addresses listed.}} | |
36 | val aliasDrop = \user -> aliasPrim (userSource user) dropTarget; | |
37 | {{Silently delete mail to the user at the current domain.}} | |
38 | ||
39 | val defaultAlias = \email -> aliasPrim defaultSource (addressTarget email); | |
a356587a | 40 | {{When a message to the current domain doesn't match any other rule, send it to |
16465a9a | 41 | this e-mail address.}} |
539abe03 AC |
42 | val defaultAliasDrop = aliasPrim defaultSource dropTarget; |
43 | {{Silently drop all mail not matching a specific rule.}} |