Annotation of 43BSDReno/usr.sbin/sendmail/cf/m4/rule3.m4, revision 1.1.1.1

1.1       root        1: divert(10)
                      2: #
                      3: # Copyright (c) 1983 Eric P. Allman
                      4: # Copyright (c) 1988 The Regents of the University of California.
                      5: # All rights reserved.
                      6: #
                      7: # Redistribution and use in source and binary forms are permitted
                      8: # provided that the above copyright notice and this paragraph are
                      9: # duplicated in all such forms and that any documentation,
                     10: # advertising materials, and other materials related to such
                     11: # distribution and use acknowledge that the software was developed
                     12: # by the University of California, Berkeley.  The name of the
                     13: # University may not be used to endorse or promote products derived
                     14: # from this software without specific prior written permission.
                     15: # THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
                     16: # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
                     17: # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
                     18: #
                     19: #      @(#)rule3.m4    1.18 (Berkeley) 2/15/89
                     20: #
                     21: divert(0)
                     22: ###########################
                     23: #  Name Canonicalization  #
                     24: ###########################
                     25: S3
                     26: 
                     27: # handle "from:<>" special case
                     28: R$*<>$*                        $@@                             turn into magic token
                     29: 
                     30: # basic textual canonicalization -- note RFC733 heuristic here
                     31: R$*<$*<$*<$+>$*>$*>$*  $4                              3-level <> nesting
                     32: R$*<$*<$+>$*>$*                $3                              2-level <> nesting
                     33: R$*<$+>$*              $2                              basic RFC821/822 parsing
                     34: 
                     35: # make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later
                     36: R@$+,$+                        @$1:$2                          change all "," to ":"
                     37: 
                     38: # localize and dispose of route-based addresses
                     39: R@$+:$+                        $@$>6<@$1>:$2                   handle <route-addr>
                     40: 
                     41: # more miscellaneous cleanup
                     42: R$+                    $:$>8$1                         host dependent cleanup
                     43: R$+:$*;@$+             $@$1:$2;@$3                     list syntax
                     44: R$+:$*;                        $@$1:$2;                        list syntax
                     45: R$+@$+                 $:$1<@$2>                       focus on domain
                     46: R$+<$+@$+>             $1$2<@$3>                       move gaze right
                     47: R$+<@$+>               $@$>6$1<@$2>                    already canonical
                     48: 
                     49: # convert old-style addresses to a domain-based address
                     50: R$+^$+                 $1!$2                           convert ^ to !
                     51: R$-!$+                 $@$>6$2<@$1.UUCP>               resolve uucp names
                     52: R$+.$-!$+              $@$>6$3<@$1.$2>                 domain uucps
                     53: R$+!$+                 $@$>6$2<@$1.UUCP>               uucp subdomains
                     54: R$+%$+                 $:$>9$1%$2                      user%host
                     55: R$+<@$+>               $@$>6$1<@$2>                    already canonical
                     56: R$-.$+                 $@$>6$2<@$1>                    host.user
                     57: 
                     58: 
                     59: #################################
                     60: #   special local conversions   #
                     61: #################################
                     62: 
                     63: S6
                     64: R$*<@$=w>$*            $:$1<@$w>$3                     get into u@$w form
                     65: R$*<@$=w.$D>$*         $:$1<@$w>$3
                     66: R$*<@$=U.UUCP>$*       $:$1<@$w>$3
                     67: 
                     68: ################################
                     69: #   Change rightmost % to @.   #
                     70: ################################
                     71: 
                     72: S9
                     73: R$*%$*                 $1@$2                           First make them all @'s.
                     74: R$*@$*@$*              $1%$2@$3                        Undo all but the last.
                     75: R$*@$*                 $@$1<@$2>                       Put back the brackets.
                     76: 

unix.superglobalmegacorp.com

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