Annotation of 43BSD/usr.lib/sendmail/cf.named/rule3.m4, revision 1.1

1.1     ! root        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.11 (Berkeley) 5/1/86
        !            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: R$+ at $+              $1@$2                           "at" -> "@" for RFC 822
        !            27: 
        !            28: # make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later
        !            29: R@$+,$+                        @$1:$2                          change all "," to ":"
        !            30: 
        !            31: # localize and dispose of route-based addresses
        !            32: R@$+:$+                        $@$>6<@$1>:$2                   handle <route-addr>
        !            33: 
        !            34: # more miscellaneous cleanup
        !            35: R$+                    $:$>8$1                         host dependent cleanup
        !            36: R$+:$*;@$+             $@$1:$2;@$3                     list syntax
        !            37: R$+:$*;                        $@$1:$2;                        list syntax
        !            38: R$+@$+                 $:$1<@$2>                       focus on domain
        !            39: R$+<$+@$+>             $1$2<@$3>                       move gaze right
        !            40: R$+<@$+>               $@$>6$1<@$2>                    already canonical
        !            41: 
        !            42: # convert old-style addresses to a domain-based address
        !            43: R$+^$+                 $1!$2                           convert ^ to !
        !            44: R$-!$+                 $@$>6$2<@$1.UUCP>               resolve uucp names
        !            45: R$+.$-!$+              $@$>6$3<@$1.$2>                 domain uucps
        !            46: R$+!$+                 $@$>6$2<@$1.UUCP>               uucp subdomains
        !            47: R$-:$+                 $@$>6$2<@$1>                    host:user
        !            48: R$-=$+                 $@$>6$2<@$1.BITNET>             resolve bitnet names
        !            49: R$+%$+                 $:$>9$1%$2                      user%host
        !            50: R$+<@$+>               $@$>6$1<@$2>                    already canonical
        !            51: R$-.$+                 $@$>6$2<@$1>                    host.user
        !            52: 
        !            53: 
        !            54: #################################
        !            55: #   special local conversions   #
        !            56: #################################
        !            57: 
        !            58: S6
        !            59: R$*<@$=w>$*            $:$1<@LOCAL>$3
        !            60: R$*<@$=w.$=D>$*                $1<@$2.LOCAL>$4                 convert local domain
        !            61: R$*<@$=w.ARPA>$*       $1<@$2.LOCAL>$3
        !            62: R$*<@$=w.EDU>$*                $1<@$2.LOCAL>$3
        !            63: R$*<@$=w.$=D.ARPA>$*   $1<@$2.LOCAL>$4
        !            64: R$*<@$=w.$=D.EDU>$*    $1<@$2.LOCAL>$4
        !            65: R$+<@LOCAL>            $@$1<@LOCAL>
        !            66: R$+<@$=w.LOCAL>                $@$1<@LOCAL>
        !            67: R<@$=w.LOCAL>:$+       $@$>3$2
        !            68: R$+<@$*.LOCAL>$*       $1<@$2>$3
        !            69: R$*<@$+.$=T.$=T>$*     $1<@$2.$3>$5                    make UUCP top level
        !            70: R$*<@$+.CC>$*          $1<@$2.$D>$3
        !            71: R$*<@ucsfcgl.UUCP>$*   $1<@cgl.ucsf.edu>$2             ucsfcgl now on Internet
        !            72: 
        !            73: ################################
        !            74: #   Change rightmost % to @.   #
        !            75: ################################
        !            76: 
        !            77: S9
        !            78: R$*%$*                 $1@$2                           First make them all @'s.
        !            79: R$*@$*@$*              $1%$2@$3                        Undo all but the last.
        !            80: R$*@$*                 $@$1<@$2>                       Put back the brackets.
        !            81: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.