SCCS-vsn: usr.sbin/sendmail/cf/m4/cf.m4 2.4
SCCS-vsn: usr.sbin/sendmail/cf/m4/proto.m4 2.4
#
# %sccs.include.redist.sh%
#
#
# %sccs.include.redist.sh%
#
-# @(#)cf.m4 2.3 (Berkeley) %G%
+# @(#)cf.m4 2.4 (Berkeley) %G%
define(`VERSIONID', ``##### $1 #####'')
define(`LOCAL_RULE_3', `divert(2)')
define(`LOCAL_RULE_0', `divert(3)')
define(`VERSIONID', ``##### $1 #####'')
define(`LOCAL_RULE_3', `divert(2)')
define(`LOCAL_RULE_0', `divert(3)')
-define(`UUCPSMTP', `R DOL(*) < @ $1 .UUCP > DOL(*) DOL(1) < @ $2 > DOL(3)')
+define(`UUCPSMTP', `R DOL(*) < @ $1 .UUCP > DOL(*) DOL(1) < @ $2 > DOL(2)')
define(`CONCAT', `$1$2$3$4$5$6$7')
define(`DOL', ``$'$1')
define(`CONCAT', `$1$2$3$4$5$6$7')
define(`DOL', ``$'$1')
+define(`SITECONFIG',
+`ifelse($2, -, `dnl', `CONCAT(D, $3, $2)')
+define(`SITE', CONCAT(C, $3, DOL(1)))dnl
+sinclude(../siteconfig/$1.m4)')
m4wrap(`include(`../m4/proto.m4')')
m4wrap(`include(`../m4/proto.m4')')
-VERSIONID(@(#)proto.m4 2.3 (Berkeley) %G%)
+VERSIONID(@(#)proto.m4 2.4 (Berkeley) %G%)
CONCAT(DR, ifdef(`LOCAL_RELAY', LOCAL_RELAY))
ifdef(`UUCP_NAME',
CONCAT(DR, ifdef(`LOCAL_RELAY', LOCAL_RELAY))
ifdef(`UUCP_NAME',
UUCP_NAME
UUCP_ALIASES
# local UUCP connections
UUCP_NAME
UUCP_ALIASES
# local UUCP connections
-`include(UUCP_HOSTS_FILE)',
+include(UUCP_HOSTS_FILE)',
`dnl')
# operators that cannot be in local usernames (i.e., network indicators)
`dnl')
# operators that cannot be in local usernames (i.e., network indicators)
ifdef(`USERDB_FILE',
`# location of user database file (null means no lookup)
ifdef(`USERDB_FILE',
`# location of user database file (null means no lookup)
-CONCAT(`OU', USERDB_FILE)', `dnl')
+CONCAT(`OU', USERDB_FILE)',
+`dnl')
ifdef(`_NO_WILDCARD_MX_',
`# we can guarantee no wildcard MX records matching our domain
ifdef(`_NO_WILDCARD_MX_',
`# we can guarantee no wildcard MX records matching our domain
include(`../m4/version.m4')
include(`../m4/version.m4')
-#ifdef(`INTERNET_RELAY',
-#`include(../sitedep/nicregistered.m4)')
+ifdef(`INTERNET_RELAY',
+`include(../sitedep/nicregistered.m4)',
+`dnl')
include(`../m4/boilerplate.m4')
include(`../m4/boilerplate.m4')
#\f
######################################################################
######################################################################
#\f
######################################################################
######################################################################
###########################################
### Rulset 3 -- Name Canonicalization ###
###########################################
###########################################
### Rulset 3 -- Name Canonicalization ###
###########################################
# handle "from:<>" special case
R$*<>$* $@@ turn into magic token
# handle "from:<>" special case
R$*<>$* $@@ turn into magic token
### Ruleset 6 -- bottom half of ruleset 3 ###
###############################################
### Ruleset 6 -- bottom half of ruleset 3 ###
###############################################
# At this point, everything should be in a local_part@domain format.
# At this point, everything should be in a local_part@domain format.
-# This ruleset is primarily responsible for
undivert(2)dnl
# handle special cases for local names
R$*<@$=w>$* $:$1<@$w>$3 no domain at all
R$*<@$=w.UUCP>$* $:$1<@$w>$3 .UUCP domain
undivert(2)dnl
# handle special cases for local names
R$*<@$=w>$* $:$1<@$w>$3 no domain at all
R$*<@$=w.UUCP>$* $:$1<@$w>$3 .UUCP domain
-R$*<@$=U.UUCP>$* $:$1<@$w>$3 UUCP-specific names
# pass to name server to make hostname canonical
R$* < @ $+ > $* $: $1 < @ $[ $2 $] > $3 then do anything
# pass to name server to make hostname canonical
R$* < @ $+ > $* $: $1 < @ $[ $2 $] > $3 then do anything
# delete duplicate local names
R$+%$=w@$=w $1@$w u%host@host => u@host
# delete duplicate local names
R$+%$=w@$=w $1@$w u%host@host => u@host
-#R$+%$=w@$=w.$D $1@$w u%host@host => u@host
+undivert(4)dnl
+
+# resolve remotely connected UUCP links
+R$* < @ $=W . UUCP > $* $#smtp $@ $W $: $1<@$2.UUCP>$3
+R$* < @ $=X . UUCP > $* $#smtp $@ $X $: $1<@$2.UUCP>$3
+R$* < @ $=Y . UUCP > $* $#smtp $@ $Y $: $1<@$2.UUCP>$3
+
# resolve fake top level domains by forwarding to other hosts
ifdef(`BITNET_RELAY',
`R$*<@$+.BITNET>$* $#smtp$@$B$:$1<@$2.BITNET>$3 user@host.BITNET',
# resolve fake top level domains by forwarding to other hosts
ifdef(`BITNET_RELAY',
`R$*<@$+.BITNET>$* $#smtp$@$B$:$1<@$2.BITNET>$3 user@host.BITNET',
`R$*<@$+.CSNET>$* $#smtp$@$C$:$1<@$2.CSNET>$3 user@host.CSNET',
`dnl')
`R$*<@$+.CSNET>$* $#smtp$@$C$:$1<@$2.CSNET>$3 user@host.CSNET',
`dnl')
-# forward non-local UUCP traffic to our UUCP relay
-R$*<@$*.UUCP>$* $#smtp$@$U$:$1<@$2.UUCP> uucp mail
-
-# hide behind our internet relay when talking to people in the .ARPA domain
-#R$*<@$*.ARPA>$* $#smtp-nic$@$2.ARPA$:$1<@$2.ARPA>$3 user@host.ARPA
-
-# but speak domains to them if they speak domains too
+ifdef(`UUCP_RELAY',
+`# forward non-local UUCP traffic to our UUCP relay
+R$*<@$*.UUCP>$* $#smtp$@$U$:$1<@$2.UUCP> uucp mail',
+`ifdef(`_UUCP_LINKED_',
+`# forward other UUCP traffic straight to UUCP
+R< @ $+ .UUCP > : $+ $#uucp $@ $1 $: $1:$2 @host.UUCP:...
+R$+ < @ $+ .UUCP> $#uucp $@ $2 $: $1 user@host.UUCP',
+ `dnl')')
+
+# deal with other remote names
R$* < @ $* > $* $# smtp $@ $2 $: $1 < @ $2 > $3 user@host.domain
# see if we forward local names
R$* < @ $* > $* $# smtp $@ $2 $: $1 < @ $2 > $3 user@host.domain
# see if we forward local names