Commit | Line | Data |
---|---|---|
15637ed4 RG |
1 | divert(10) |
2 | # | |
3 | # Sendmail | |
4 | # Copyright (c) 1983 Eric P. Allman | |
5 | # Berkeley, California | |
6 | # | |
7 | # Copyright (c) 1983 Regents of the University of California. | |
8 | # All rights reserved. The Berkeley software License Agreement | |
9 | # specifies the terms and conditions for redistribution. | |
10 | # | |
11 | # @(#)rule3.m4 1.17 (Berkeley) 1/3/89 | |
12 | # | |
13 | divert(0) | |
14 | ########################### | |
15 | # Name Canonicalization # | |
16 | ########################### | |
17 | S3 | |
18 | ||
19 | # handle "from:<>" special case | |
20 | R$*<>$* $@@ turn into magic token | |
21 | ||
22 | # basic textual canonicalization -- note RFC733 heuristic here | |
23 | R$*<$*<$*<$+>$*>$*>$* $4 3-level <> nesting | |
24 | R$*<$*<$+>$*>$* $3 2-level <> nesting | |
25 | R$*<$+>$* $2 basic RFC821/822 parsing | |
26 | ||
27 | # make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later | |
28 | R@$+,$+ @$1:$2 change all "," to ":" | |
29 | ||
30 | # localize and dispose of route-based addresses | |
31 | R@$+:$+ $@$>6<@$1>:$2 handle <route-addr> | |
32 | ||
33 | # more miscellaneous cleanup | |
34 | R$+ $:$>8$1 host dependent cleanup | |
35 | R$+:$*;@$+ $@$1:$2;@$3 list syntax | |
36 | R$+:$*; $@$1:$2; list syntax | |
37 | R$+@$+ $:$1<@$2> focus on domain | |
38 | R$+<$+@$+> $1$2<@$3> move gaze right | |
39 | R$+<@$+> $@$>6$1<@$2> already canonical | |
40 | ||
41 | # convert old-style addresses to a domain-based address | |
42 | R$+^$+ $1!$2 convert ^ to ! | |
43 | R$-!$+ $@$>6$2<@$1.UUCP> resolve uucp names | |
44 | R$+.$-!$+ $@$>6$3<@$1.$2> domain uucps | |
45 | R$+!$+ $@$>6$2<@$1.UUCP> uucp subdomains | |
46 | R$+%$+ $:$>9$1%$2 user%host | |
47 | R$+<@$+> $@$>6$1<@$2> already canonical | |
48 | R$-.$+ $@$>6$2<@$1> host.user | |
49 | ||
50 | ||
51 | ################################# | |
52 | # special local conversions # | |
53 | ################################# | |
54 | ||
55 | S6 | |
56 | R$*<@$=w>$* $:$1<@$w>$3 get into u@$w form | |
57 | R$*<@$=w.$D>$* $:$1<@$w>$3 | |
58 | R$*<@$=U.UUCP>$* $:$1<@$w>$3 | |
59 | ||
60 | ################################ | |
61 | # Change rightmost % to @. # | |
62 | ################################ | |
63 | ||
64 | S9 | |
65 | R$*%$* $1@$2 First make them all @'s. | |
66 | R$*@$*@$* $1%$2@$3 Undo all but the last. | |
67 | R$*@$* $@$1<@$2> Put back the brackets. | |
68 |