default confSMTP_MAILER to "smtp"; make mailer:host processing
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Sat, 24 Jul 1993 00:44:15 +0000 (16:44 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Sat, 24 Jul 1993 00:44:15 +0000 (16:44 -0800)
generic (and fix a problem that caused it to be confused with
route-addr syntax)

SCCS-vsn: usr.sbin/sendmail/cf/m4/proto.m4 8.9

usr/src/usr.sbin/sendmail/cf/m4/proto.m4

index 6265479..b457b8f 100644 (file)
@@ -8,23 +8,30 @@ divert(-1)
 #
 divert(0)
 
 #
 divert(0)
 
-VERSIONID(`@(#)proto.m4        8.8 (Berkeley) %G%')
+VERSIONID(`@(#)proto.m4        8.9 (Berkeley) %G%')
 
 MAILER(local)dnl
 
 ifdef(`_OLD_SENDMAIL_',
 
 MAILER(local)dnl
 
 ifdef(`_OLD_SENDMAIL_',
-`define(`_SET_96_', 6)dnl
+`define(`_SET_95_', 5)dnl
+define(`_SET_96_', 6)dnl
 define(`_SET_97_', 7)dnl
 define(`_SET_98_', 8)dnl',
 `# level 4 config file format
 V4
 define(`_SET_97_', 7)dnl
 define(`_SET_98_', 8)dnl',
 `# level 4 config file format
 V4
+define(`_SET_95_', 95)dnl
 define(`_SET_96_', 96)dnl
 define(`_SET_97_', 97)dnl
 define(`_SET_98_', 98)dnl')
 define(`_SET_96_', 96)dnl
 define(`_SET_97_', 97)dnl
 define(`_SET_98_', 98)dnl')
-ifdef(`confSMTP_MAILER',, `define(`confSMTP_MAILER', `esmtp')')dnl
+ifdef(`confSMTP_MAILER',, `define(`confSMTP_MAILER', `smtp')')dnl
 ifdef(`confLOCAL_MAILER',, `define(`confLOCAL_MAILER', `local')')dnl
 ifdef(`confLOCAL_MAILER',, `define(`confLOCAL_MAILER', `local')')dnl
+ifdef(`confRELAY_MAILER',,
+       `define(`confRELAY_MAILER',
+               `ifdef(`_MAILER_smtp_', `relay',
+                       `ifdef(`_MAILER_uucp', `suucp', `unknown')')')')dnl
 define(`_SMTP_', `confSMTP_MAILER')dnl         for readability only
 define(`_LOCAL_', `confLOCAL_MAILER')dnl       for readability only
 define(`_SMTP_', `confSMTP_MAILER')dnl         for readability only
 define(`_LOCAL_', `confLOCAL_MAILER')dnl       for readability only
+define(`_RELAY_', `confRELAY_MAILER')dnl       for readability only
 
 ##################
 #   local info   #
 
 ##################
 #   local info   #
@@ -568,7 +575,7 @@ ifdef(`_LOCAL_RULES_',
 R$* < @ $* > $*                $#smtp $@ $2 $: $1 @ $2 $3              user@host.domain')')
 ifdef(`SMART_HOST',
 `# pass names that still have a host to a smarthost
 R$* < @ $* > $*                $#smtp $@ $2 $: $1 @ $2 $3              user@host.domain')')
 ifdef(`SMART_HOST',
 `# pass names that still have a host to a smarthost
-R$* < @ $* > $*                $: < $S > $1 < @ $2 > $3        glue on smarthost name
+R$* < @ $* > $*                $: $>_SET_95_ < $S > $1 < @ $2 > $3     glue on smarthost name
 R< $- : $+ > $*                $# $1 $@ $2 $: $3               if non-null, use it
 R< $+ > $*             $#suucp $@ $1 $: $2             if non-null, use it
 R<> $*                 $: $1                           else strip off gunk',
 R< $- : $+ > $*                $# $1 $@ $2 $: $3               if non-null, use it
 R< $+ > $*             $#suucp $@ $1 $: $2             if non-null, use it
 R<> $*                 $: $1                           else strip off gunk',
@@ -581,12 +588,9 @@ ifdef(`_MAILER_smtp_',
 ifdef(`_OLD_SENDMAIL_',
 `# forward remaining names to local relay, if any
 R$=L                   $#_LOCAL_ $: $1                 special local names
 ifdef(`_OLD_SENDMAIL_',
 `# forward remaining names to local relay, if any
 R$=L                   $#_LOCAL_ $: $1                 special local names
-R$+                    $: $1 < @ $R >                  append relay
-R$+ < @ >              $: $1 < @ $H >                  no relay, try hub
-R$+ < @ >              $#_LOCAL_ $: $1                 no relay or hub: local
-R$+ < @ $=w  >         $#_LOCAL_ $: $1                 we are relay/hub: local
-R$+ < @ $-:$+ >                $# $2 $@ $3 $: $1               deliver to relay/hub
-R$+ < @ $+ >           $#relay $@ $2 $: $1             deliver to relay/hub',
+R$+                    $: $>_SET_95_ < $R > $1                 try relay
+R$+                    $: $>_SET_95_ < $H > $1                 try hub
+R$+                    $#_LOCAL_ $: $1                 no relay or hub: local',
 
 `# if this is quoted, strip the quotes and try again
 R$+                    $: $(dequote $1 $)              strip quotes
 
 `# if this is quoted, strip the quotes and try again
 R$+                    $: $(dequote $1 $)              strip quotes
@@ -604,12 +608,8 @@ R$+                        $#_LOCAL_ $: $1                 regular local names
 S5
 
 # see if we have a relay or a hub
 S5
 
 # see if we have a relay or a hub
-R$+                    $: $1 < @ $R >
-R$+ < @ >              $: $1 < @ $H >                  no relay, try hub
-R$+ < @ $=w >          $@ $1                           we are relay/hub: local
-R$+ < @ $-:$+ >                $# $2 $@ $3 $: $1               send to relay or hub
-ifdef(`_MAILER_smtp_',
-`R$+ < @ $+ >          $#relay $@ $2 $: $1             send to relay or hub')')
+R$+                    $: $>_SET_95_ < $R > $1                 try relay
+R$+                    $: $>_SET_95_ < $H > $1                 try hub')
 ifdef(`MAILER_TABLE',
 `
 
 ifdef(`MAILER_TABLE',
 `
 
@@ -619,12 +619,22 @@ ifdef(`MAILER_TABLE',
 ###################################################################
 
 S90
 ###################################################################
 
 S90
-R<$- . $+ > $*         $: < $(mailertable .$2 $) > $3  lookup
+R<$- . $+ > $*         $: < $(mailertable .$2 $@ $1 $) > $3    lookup
 R<$- : $+ > $*         $# $1 $@ $2 $: $3               check -- resolved?
 R< . $+ > $*           $@ $>90 <$1> $2                 no -- strip & try again
 R<$*> $*               $@ $2                           no match',
 `dnl')
 
 R<$- : $+ > $*         $# $1 $@ $2 $: $3               check -- resolved?
 R< . $+ > $*           $@ $>90 <$1> $2                 no -- strip & try again
 R<$*> $*               $@ $2                           no match',
 `dnl')
 
+###################################################################
+###  Ruleset _SET_95_ -- canonify mailer:host syntax to triple ###
+###################################################################
+
+S`'_SET_95_
+R< > $*                        $@ $1                           strip off null relay
+R< $- : $+ > $*                $# $1 $@ $2 $: $3               try qualified mailer
+R< $=w > $*            $@ $2                           delete local host
+R< $+ > $*             $#_RELAY_ $@ $1 $: $2           use unqualified mailer
+
 ###################################################################
 ###  Ruleset _SET_98_ -- local part of ruleset zero (can be null)      ###
 ###################################################################
 ###################################################################
 ###  Ruleset _SET_98_ -- local part of ruleset zero (can be null)      ###
 ###################################################################