sendmail.cf for domain addresses

Tom Dunigan dunigan at ORNL-MSR.ARPA
Thu Oct 10 22:35:43 AEST 1985


Attached is a copy of our sendmail.cf that alters ruleset 14 to
insure that your local domain name is appended to from-fields
and to accpet addresses of the form
  user at domain1.domain2.domain3
(the main re-write rule elminated to support domain addresses in S14
 is the rule reading   R$+<@$+.$-.ARPA> . . . . )
This does not use the new name-binder.  Merging the changes with
your own sendmail.cf will surely prove exciting.  You can test
your new .cf file with   /usr/lib/sendmail -bt -C newsendmail.cf
---------------------------

############################################################
############################################################
#####
#####		SENDMAIL CONFIGURATION FILE
#####
#####
#####    msr   m4   4/19/84
#####
############################################################
############################################################

CwORNL-MSR
DwORNL-MSR

############################################################
###	local info
############################################################


# domain
DDARPA
CDARPA

# official hostname
Dj$w.$D

# internet hostname
DA$j

# UUCP name
DUornl-msr
CUornl-msr

# UUCP connections
CVtms orchem ornl10 prores

# other connections
CWornl-ipsc ornl-msr

#known upper level domains
CTARPA UUCP

# we have full sendmail support
Oa

############################################################
#
#	General configuration information
#
#	This information is basically just "boiler-plate"; it must be
#	there, but is essentially constant.
#
#	Information in this file should be independent of location --
#	i.e., although there are some policy decisions made, they are
#	not specific to Berkeley per se.
#
#		@(#)base.m4	4.3		8/30/83
#
############################################################

#	@(#)version.m4	4.7		8/31/83

DV4.9


##########################
###   Special macros   ###
##########################

# my name
DnMAILER-DAEMON
# UNIX header format
DlFrom $g  $d
# delimiter (operator) characters
Do.:%@!^=/[]
# format of a total name
Dq$g$?x ($x)$.
# SMTP login message
De$j Sendmail $v/$V ready at $b

# forwarding host -- redefine this if you can't talk to the relay directly
DF$R

###################
###   Options   ###
###################

# location of alias file
OA/usr/lib/aliases
# default delivery mode (deliver in background)
Odbackground
# (don't) connect to "expensive" mailers
#Oc
# temporary file mode
OF0600
# default GID
Og1
# location of help file
OH/usr/lib/sendmail.hf
# log level
OL9
# default messages to old style
Oo
# queue directory
OQ/usr/spool/mqueue
# read timeout -- violates protocols
Or2h
# status file
OS/usr/lib/sendmail.st
# queue up everything before starting transmission
Os
# default timeout interval
OT3d
# time zone names (V6 only)
OtEST,EDT
# default UID
Ou1

###############################
###   Message precedences   ###
###############################

Pfirst-class=0
Pspecial-delivery=100
Pjunk=-100

#########################
###   Trusted users   ###
#########################

Troot
Tdaemon
Tuucp
Tnetwork
Tdunigan

#############################
###   Format of headers   ###
#############################

H?P?Return-Path: <$g>
HReceived: $?sfrom $s $.by $j ($v/$V)
	id $i; $b
H?D?Resent-Date: $a
H?D?Date: $a
H?F?Resent-From: $q
H?F?From: $q
H?x?Full-Name: $x
HSubject:
# HPosted-Date: $a
# H?l?Received-Date: $b
H?M?Resent-Message-Id: <$t.$i@$j>
H?M?Message-Id: <$t.$i@$j>

###########################
###   Rewriting rules   ###
###########################


################################
#  Sender Field Pre-rewriting  #
################################
S1
#R$*<$*>$*		$1$2$3				defocus
# compress is1 names down to user%host format in from fields
#Rcsd44!$*!ctd10!$-	$@$2%ornl10			user%local
#Rcsd44$*!$-		$@$2%tms			user%local
#R$*!ctd10!$+<@csd44.UUCP>	$@$2%ornl10		user%local
#failedR$*$+<@csd44.UUCP>	$@$2%tms			user%local

###################################
#  Recipient Field Pre-rewriting  #
###################################
S2
#R$*<$*>$*		$1$2$3				defocus

#################################
#  Final Output Post-rewriting  #
#################################
S4

R@			$@				handle <> error addr

# externalize local domain info
R$*<$*LOCAL>$*		$1<$2$D>$3			change local info
R$*<$+>$*		$1$2$3				defocus
R@$+:$+:$+		$@@$1,$2:$3			<route-addr> canonical

# UUCP must always be presented in old form
R$+@$-.UUCP		$2!$1				u at h.UUCP => h!u

# delete duplicate local names -- mostly for arpaproto.mc
R$+%$=w@$=w		$1@$A				u%UCB at UCB => u at UCB.ARPA
R$+%$=w@$=w.ARPA	$1@$A				u%UCB at UCB => u at UCB.ARPA

# to make IS1 mail happier seismo uucp problem
#	 in:  @...x...:...y...
#	 out: ...y...
S6
R$+:$+			$2				is1 fix
# domain-based address disposal
#  user at host.domain -->  whatever
R$*<@$*.CSNET>		$1<%$2.CSNET at CSNET-RELAY.ARPA>	CSNET domain thd
R$*<@$*.BITNET>		$1<%$2.BITNET at WISCVM.ARPA>	BITNET domain thd
R$*<@$*.DEC>		$1<%$2.DEC at DECWRL.ARPA>		DEC domain thd
R$*<@$*.JANET>		$1<%$2.JANET at CS.UCL.AC.UK>	JANET domain thd
R$*<@$*.MAILNET>	$1<%$2.MAILNET at MIT-MULTICS.ARPA>	MAILNET thd
R$*<@$*.OZ>		$1<%$2.OZ at SEISMON.CSS.GOV>	OZ domain thd
R$*<@$*.MFENET>		$1<%$2 at LLL-MFE.ARPA>		MFENET domain thd
#R$*<@$~V.UUCP>		$2!$1.UUCP<@UCB-VAX.ARPA>	UUCP domain thd

# map our local V names to uucp form
R$*<@ornl10>$*		csd44!ctd10!$1			thd
R$*<@tms>$*		csd44!$1			thd
R$*<@$=V>$*		$2!$1


# local msr stuff to take care of IS1 uucp From:
#  in:  user at csd44!....!host.UUCP
# out:  csd44! . . .!host!user
S8
R$+!$+.bitnet$*		$:$1%$2.bitnet$3		is1 bitnet munge
R$*CSD44$*		$:$1csd44$2			CSD44 --> csd44
R$+ at csd44$+.UUCP	csd44$2!$1			make palatable

###########################
#  Name Canonicalization  #
###########################
S3

# handle "from:<>" special case
R<>			$@@				turn into magic token

# basic textual canonicalization
R$*<$+>$*		$2				basic RFC821/822 parsing
R$+ at $+		$1@$2				"at" -> "@" for RFC 822
R$*<$*>$*		$1$2$3				in case recursive

# make sure <@a, at b, at c:user at d> syntax is easy to parse -- undone later
R@$+,$+			@$1:$2				change all "," to ":"

# localize and dispose of domain-based addresses
R@$+:$+			$@$>6<@$1>:$2			handle <route-addr>

# more miscellaneous cleanup
R$+			$:$>8$1				host dependent cleanup
R$+:$*;@$+		$@$1:$2;@$3			list syntax
R$+@$+			$:$1<@$2>			focus on domain
R$+<$+@$+>		$1$2<@$3>			move gaze right
R$+<@$+>		$@$>6$1<@$2>			already canonical

# convert old-style addresses to a domain-based address
R$+%$+			$@$>6$1<@$2>			user%host
R$-:$+			$@$>6$2<@$1>			host:user
#R$-.$+			$@$>6$2<@$1>			host.user
R$+^$+			$1!$2				convert ^ to !
R$+!$U!$+		$2				collapse loops thd
R$-!$+			$@$>6$2<@$1.UUCP>		resolve uucp names


############################################################
############################################################
#####
#####		RULESET ZERO PREAMBLE
#####
#####	The beginning of ruleset zero is constant through all
#####	configurations.
#####
#####		@(#)zerobase.m4	4.1		7/25/83
#####
############################################################
############################################################

S0

# first make canonical
R$*<$*>$*		$1$2$3				defocus
R$+			$:$>3$1				make canonical

# handle special cases.....
R@			$#local$:MAILER-DAEMON		handle <> form
R$*<@[$+]>$*		$#tcp$@[$2]$:$1@[$2]$3		numeric internet spec

# arrange for local names to be fully qualified
R$*<$*$=Z>$*		$1<$2$3.LOCAL>$4		user at berkhost
R$*<$+.ARPA.LOCAL>$*	$1<$2.ARPA>$3			because ARPA is a host

# now delete the local info
R$*<$*$=w.LOCAL>$*	$1<$2>$4			thishost.LOCAL
R$*<$*$=w.ARPA>$*	$1<$2>$4			thishost.ARPA
R$*<$*$=w.UUCP>$*	$1<$2>$4			thishost.UUCP
R$*<$*$=w>$*		$1<$2>$4			thishost
R$*<$*.>$*		$1<$2>$3			drop trailing dot
R<@>:$*			$@$>0$1				retry after route strip
R$*<@>			$@$>0$1				strip null trash & retry

# forward around hosts with communication problems
R$*<@$=F.LOCAL>$*	$#ether$@$F$:$1<@$2.LOCAL>$3	reroute message

##################################
#  End of ruleset zero preamble  #
##################################


###############################################
###  Machine dependent part of rulset zero  ###
###############################################

# this is strange, if user at foo.bar.baz.ARPA, look up baz in /etc/hosts
R$*<@$*$-.ARPA>$*	$#tcp$@$3$:$1<@$2$3.ARPA>$4	user at tcphost.ARPA

R<@$+.UUCP>:$+		$1!$2				to old form
R$+<@$+.UUCP>		$2!$1

# pass rest of remote names to tcp (pass full domain name a.b.c   thd)
R$*<@$+>$*		$#tcp$@$2$:$1<@$2>$3		user at domain
# resolve local UUCP links 
R$-!$+			$#uucp$@$1$:$2			localhost!user
# everything else must be a local name
R$+			$#local$:$1			local names

############################################################
############################################################
#####
#####		Local and Program Mailer specification
#####
#####		@(#)localm.m4	4.1		7/25/83
#####
############################################################
############################################################

Mlocal,	P=/bin/mail, F=rlsDFMmn, S=10, R=20, A=mail -d $u
Mprog,	P=/bin/sh,   F=lsDFMe,   S=10, R=20, A=sh -c $u

S10
R@			MAILER-DAEMON			errors to mailer-daemon

############################################################
############################################################
#####
#####		Arpanet TCP Mailer specification
#####
#####		@(#)tcpm.m4	4.1		7/25/83
#####
############################################################
############################################################

Mtcp,	P=[IPC], F=msDFMueXL, S=14, R=14, A=IPC $h, E=\r\n

S14
R$+@[$+]		$@$1@[$2]		already ok (inet addr spec)
# output local hosts in user%host at Berkeley syntax
R$+<@$*$=W>		$@$1%$2$3<@$A>			thd
R$+<@$*$=V>		$@$1%$2$3<@$A>			thd
R$+<@$-.UUCP>		$2!$1@$A		local uucp hosts in from thd
R@$+$*			$@@$1$2			resolve <route-addr>
R$+@$+			$@$>7$1@$2		fix up names for the internet
R$+			$@$1@$A			add our official host name

# convert to % format
S7
R$+@$+.MAILNET		$1%$2.MAILNET at mit-multics.arpa	user at host.MAILNET
R$+@$+.BITNET		$1%$2.BITNET at wiscvm.arpa	user at host.BITNET
R$+@$+.MFENET		$1%$2 at LLL-MFE.ARPA		user at host.MFENET
R$+@$+.CSNET		$1%$2.CSNET at csnet-relay.arpa	user at host.CSNET
R$+@$+.JANET		$1%$2.JANET at cs.ucl.ac.uk	user at host.JANET
R$+@$+.DEC		$1%$2.DEC at decwrl.arpa		user at host.DEC
R$+@$+.OZ		$1%$2.OZ at seismo.css.gov		user at host.OZ

############################################################
############################################################
#####
#####		UUCP Mailer specification
#####
#####		@(#)uucpm.m4	4.2		8/30/83
#####
############################################################
############################################################

############################################################
############################################################
#####
#####		Provide Backward Compatibility
#####
#####		@(#)compat.m4	4.2		8/30/83
#####
############################################################
############################################################



#####################################################
#  General code to convert back to old style names  #
#####################################################
S5

R$+<@$-.LOCAL>		$2:$1				u at h.LOCAL => h:u
R$+<@$-.UUCP>		$2!$1				u at host.UUCP => host!u
R$+@$+.ARPA		$1@$2				u at host.ARPA => u at host


Muucp,	P=/usr/bin/uux, F=sDFMhuU, S=13, R=23, M=500000,
	A=uux - -r $h!rmail ($u)

S13
R$+			$:$>5$1				convert to old style
R$=w!$+			$2				strip local name
R$*<@$=V>$*		$1				remove locals thd
R$*<@$=w>$*		$1				remove locals thd
R$*<@$->$*		$1<@$2.ARPA>$3			resolve abbreviations
R$+			$:$U!$1				stick on our host name
R$=w!$=R:$+		$:$1!$3				ucbvax!ucbvax:xxx

S23
R$+			$:$>5$1				convert to old style
R$*<@$=V>$*		$1				remove locals thd
R$*<@$=w>$*		$1				remove locals thd
R$*<@$->$*		$1<@$2.ARPA>$3			resolve abbreviations



More information about the Comp.unix.wizards mailing list