This commit was generated by cvs2svn to track changes on a CVS vendor
[unix-history] / usr.sbin / sendmail / cf / m4 / rule3.m4
CommitLineData
15637ed4
RG
1divert(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#
13divert(0)
14###########################
15# Name Canonicalization #
16###########################
17S3
18
19# handle "from:<>" special case
20R$*<>$* $@@ turn into magic token
21
22# basic textual canonicalization -- note RFC733 heuristic here
23R$*<$*<$*<$+>$*>$*>$* $4 3-level <> nesting
24R$*<$*<$+>$*>$* $3 2-level <> nesting
25R$*<$+>$* $2 basic RFC821/822 parsing
26
27# make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later
28R@$+,$+ @$1:$2 change all "," to ":"
29
30# localize and dispose of route-based addresses
31R@$+:$+ $@$>6<@$1>:$2 handle <route-addr>
32
33# more miscellaneous cleanup
34R$+ $:$>8$1 host dependent cleanup
35R$+:$*;@$+ $@$1:$2;@$3 list syntax
36R$+:$*; $@$1:$2; list syntax
37R$+@$+ $:$1<@$2> focus on domain
38R$+<$+@$+> $1$2<@$3> move gaze right
39R$+<@$+> $@$>6$1<@$2> already canonical
40
41# convert old-style addresses to a domain-based address
42R$+^$+ $1!$2 convert ^ to !
43R$-!$+ $@$>6$2<@$1.UUCP> resolve uucp names
44R$+.$-!$+ $@$>6$3<@$1.$2> domain uucps
45R$+!$+ $@$>6$2<@$1.UUCP> uucp subdomains
46R$+%$+ $:$>9$1%$2 user%host
47R$+<@$+> $@$>6$1<@$2> already canonical
48R$-.$+ $@$>6$2<@$1> host.user
49
50
51#################################
52# special local conversions #
53#################################
54
55S6
56R$*<@$=w>$* $:$1<@$w>$3 get into u@$w form
57R$*<@$=w.$D>$* $:$1<@$w>$3
58R$*<@$=U.UUCP>$* $:$1<@$w>$3
59
60################################
61# Change rightmost % to @. #
62################################
63
64S9
65R$*%$* $1@$2 First make them all @'s.
66R$*@$*@$* $1%$2@$3 Undo all but the last.
67R$*@$* $@$1<@$2> Put back the brackets.
68