[comp.os.vms] ULTRIX mailer configuration problem

carl@CITHEX.CALTECH.EDU.UUCP (05/29/87)

 > We have a VMS machine acting as a communications gateway between our many
 > mostly incompatible campus nets, and we have an ULTRIX machine to act as a
 > DECNET to TCP/IP gateway.  The ULTRIX machine is running the standard
 > (DEC supplied ?) generic ARPA sendmail configuration file.

There's your problem right there.  The "generic ARPA sendmail" configuration
file is terrible for most sites.  It's actually the sendmail.cf from some
site at Berkeley, and has all kinds of stuff that you don't need and don't
want in it.  I had to configure a system running ultrix that was to talk
to two other ULTRIX machines and a VMS machine with TCP/IP via SMTP, and
a VMS machine with UUCP via the UUCP protocol.  It took about a month to
figure out how sendmail works and get it to parse things right.  In the
process of doing so, I had to throw out much of what was in the file in
the first place.

 > I have figured out how to send mail from DECNET to SMTP mailers:
 >         ULTRIX_host::"name@UNIX_host"
 > (An extra set of quotes is needed if this is to be used as a forwarding
 > address).
 > The big question is how to send mail the other way. I have tried every
 > conceivable combination of "DECNET_host::name"@ULTRIX_host that I can 
 > think of, but the ARPA address parser converts the :: to .. before
 > it can realize that it wants to send the address to the Mail-11 program.
 > Any helpful hints would be appreciated.
 > Please reply directly, as I do not usually read this list.

There are several things you can do to help figure things out.  First,
sendmail has a test mode that lets you see what output a given macro in
the sendmail.cf file produces, given user-supplied input.  Second, mail
accepts a flag (-v?) to force it to tell you what it's doing.  Between these
two, you should be able to figure out what's going on.  It sounds to me
like the problem is that your sendmail.cf isn't checking early enough for
MAIL-11 syntax.  Fixing that will require rewriting the S0 macro. The
sendmail.cf in use on the ULTRIX machine ODIN to talk to the ULTRIX machines
FREY and THOR and the VMS machine SURTUR via SMTP and to the VMS machine CITHEX
via UUCP follows as an example of a setup with most of the Berkeleyisms
removed. Note: ODIN is also known as CITSRL. Beware: this sendmail.cf has
the peculiar feature that it changes the sender address so that the original
machine appears to be CITSRL.CALTECH.EDU for any mail sent from ODIN, FREY,
THOR, or SURTUR.  If you still have trouble, I'd be willing to have a look
at the problem if you send me your sendmail.cf once you get it as close
to working as you can.
							-Carl J Lydick

#   S0  Main ruleset: parses addresses & selects mailer.
#   S1	Sender Field Pre-rewriting
#   S2	Recipient Field Pre-rewriting
#   S3	Name Canonicalization
#   S4	Final Output Post-rewriting
#   S5	General code to convert back to old UUCP-style names
#   S6	Special local conversions
#   S8	Host dependent address cleanup
#   S10	Local and Program Mailer sender rewriting
#   S11	Ethernet Mailer sender rewriting
#   S13	UUCP Mailer sender rewriting
#   S14	ARPAnet TCP Mailer address rewriting
#   S21	Ethernet Mailer recipient rewriting
#   S23	UUCP Mailer recipient rewriting
#   w 	Internet name  |   U	UUCP name(s)    |   W	UUCP partner(s)
#   D 	local DOMAIN   |   R	Routing node    |   j	Official hostname
#   S	INET partner   |   T	Top domains     |   F	Forwarding host
############################################################
############################################################
#####
#####		SENDMAIL CONFIGURATION FILE
#####
#####		@(#)arpa.mc	4.2		8/6/83
#####
############################################################
############################################################



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

# internet hostname
Cwodin citsrl

# uucp hostnames
DUcitsrl
CUcitsrl odin

# local UUCP connections
DWcithex
CWcithex

# we have full sendmail support here
Oa

#################################################
#
#	General configuration information
#
#	@(#)csbase.m4	4.3		8/21/83
#
#################################################

######################
#   General Macros   #
######################

# our arpanet gateway
# DAcithex
# CAcithex

# local domain names
DDCALTECH
CDCALTECH UUCP

# major relay host
DRcithex
CRcithex

# my official hostname
DjCitsrl.Caltech.Edu

# known SMTP/ethernet hosts (this domain only) -- only $R need be complete
CSsurtur frey odin thor citsrl

# known top-level domains
CTARPA BITNET EDU UUCP

############################################################
#
#	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	1.2	(ULTRIX)	2/8/85
#
############################################################

#	@(#)version.m4	1.2	(ULTRIX)	2/8/85

DV4.7


##########################
###   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
OF0644
# default GID
Og1
# location of help file
OH/usr/lib/sendmail.hf
# log level
OL16
# 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
# wizard's password
OWa/FjIfuGKXyc2

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

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

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

Troot
Tdaemon
Tuucp
Tnetwork

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

H?P?Return-Path: <$g>
H?R?Received: $?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@$w.caltech.edu>

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


################################
#  Sender Field Pre-rewriting  #
################################
S1
#R$*<$*>$*		$1$2$3				defocus

###################################
#  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@h.UUCP => h!u

# delete duplicate local names -- mostly for arpaproto.mc
R$+%$=w@$=w		$1@$3				u%odin@frey => u@frey
R$+%$=w@$=w.$D		$1@$3.$D			u%UCB@UCB => u@UCB

###########################
#  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,@b,@c:user@d> syntax is easy to parse -- undone later
R@$+,$+			@$1:$2				change all "," to ":"

# Mail-11 syntax
R$+::$+			$@$1::$2			handle <route-addr>

# 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$-!$+			$@$>6$2<@$1.UUCP>		resolve uucp names


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

##### special local conversions
S6
R$*<@$=S$*$=D>$*	$1<@$2$3LOCAL>$5		convert local domain
R$*<@$=S$*$=D.EDU>$*	$1<@$2$3LOCAL>$5
R$+%$+<@LOCAL>		$1<@$2.LOCAL>			hack for % syntax
R$*<@$+.$=T.$=T>$*	$1<@$2.$3>$5			make UUCP top level
R$*<@$+.$=T.$=T>$*	$1<@$2.$3>$5			make UUCP top level

############################################################
############################################################
#####
#####		Local and Program Mailer specification
#####
#####		@(#)localm.m4	1.2	(ULTRIX)	2/8/85
#####
############################################################
############################################################

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

S10
R@			MAILER-DAEMON			errors to mailer-daemon

############################################################
############################################################
#####    
#####		Ethernet Mailer specification
#####
#####		@(#)etherm.m4	4.1		7/25/83
#####
############################################################
############################################################

Mether,	P=[IPC], F=msDFMueCX, S=11, R=21, A=IPC $h

S11
R$*<@$+>$*		$@$1<@$2>$3			already ok
R$+			$@$1<@$j>	tack on our hostname

S21



############################################################
############################################################
#####
#####		RULESET ZERO PREAMBLE
#####
#####	The beginning of ruleset zero is constant through all
#####	configurations.
#####
#####		@(#)zerobase.m4	1.2	(ULTRIX)	2/8/85
#####
############################################################
############################################################

S0

# The Mail-11 mailer
R$+::$+			$#Dmail$@$1$:$2

# 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$*<$*$=S>$*		$1<$2$3.LOCAL>$4		user@etherhost
R$*<$*$=Z>$*		$1<$2$3.LOCAL>$4		user@berkhost

# now delete the local info
R$*<$*$=w.LOCAL>$*	$1<$2>$4			thishost.LOCAL
R$*<$*$=w.$D>$*		$1<$2>$5			thishost.$D
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 ruleset zero  ###
################################################

# resolve names we can handle locally
R<@$+.UUCP>:$+		$1!$2				to old format
R$+<@$+.UUCP>		$2!$1				to old format
R$-!$+			$#uucp$@$1$:$2			host!user

# optimize names of known ethernet hosts
R$*<@$=w$*>$*		$#local$:$1
R$*<@$*$=S.LOCAL>$*	$#ether$@$3$:$1<@$2$3>$4	user@etherhost.Berkeley
R$*<@$*$=S>$*		$#ether$@$3$:$1<@$2$3>$4	user@etherhost.Berkeley

# other non-local names will be kicked upstairs
R$+@$+			$#uucp$@$R$:$1@$2		user@some.where

# everything else is a local name
R$+			$#local$:$1			local names

########################################
###  Host dependent address cleanup  ###
########################################

S8
R$*$=U!$+@$+		$3@$4				drop uucp forward


############################################################
############################################################
#####
#####		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

# pass <route-addr>'s through
R<@$+>$*		$@<@$1>$2			resolve <route-addr>

# map colons to dots everywhere.....
R$*:$*			$1.$2				map colons to dots

# handle the simple case....
R$+<@$-.$D>		$@$1<@$2.$D>			user@host.$D

# fully qualify computer center names so the rest works nicely

# output local hosts in user%host@Berkeley syntax

# handle other external cases
R$+<@$->		$@$1<@$2>			no .ARPA on simple names
R$+<@$+.$-.$D>		$@$1%$2<@$3.$D>			approximate something
R$+<@[$+]>		$@$1<@[$2]>			already ok

# convert remaining addresses to old format and externalize appropriately
R$+			$:$>5$1				=> old format

############################################################
############################################################
#####
#####		UUCP Mailer specification
#####
#####		@(#)uucpm.m4	1.2	(ULTRIX)	2/8/85
#####
############################################################
############################################################


############################################################
############################################################
#####
#####		Provide Backward Compatibility
#####
#####		@(#)compat.m4	1.2	(ULTRIX)	2/8/85
#####
############################################################
############################################################

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

R$+<@$-.LOCAL>		$2:$1				u@h.LOCAL => h:u
R$+<@$-.CC>		$2:$1				u@h.CC => h:u
R$+<@$=Z>		$@$2:$1				u@bhost => h:u
R$+<@$=C>		$@$2:$1				u@cchost => h:u
R$+<@$-.UUCP>		$2!$1				u@host.UUCP => host!u
#R$+@$+.ARPA		$1@$2				u@host.ARPA => u@host
Muucp,	P=/usr/bin/uux, F=sDFMhuU, S=13, R=23, M=100000,
	A=uux - $h!rmail ($u)

S13
R$+			$:$>5$1				convert to old style
R$U:$+			$1				strip local name
R$*<@$=S>$*		$1$3		resolve abbreviations
R$*<@$=Z>$*		$1$3		resolve abbreviations
R$+			$:$U!$1				stick on our host name
R$=w!$=R:$+		$:$1!$3				node!node:xxx

S23
R$+			$:$>5$1				convert to old style
R$*<@$=S>$*		$1$3		resolve abbreviations
R$*<@$=Z>$*		$1$3		resolve abbreviations