Ultrix sendmail.cf problem

John P. Carris carris at dinl.uucp
Tue Feb 9 07:27:37 AEST 1988


I apologize if this has been answered before but I am fairly new to the net.
I am having some trouble with my sendmail.cf trying to interpret any address
of the form user at sitename.whatever. This happens whenever I try to REPLY to
mail sent to my site via UUCP. This is an example of what happens when I reply
to received mail. The first couple of lines are what I receive, afterwards
what the MAILER-DAEMON sends me when trying to reply to it. Apologies to
Greg Woods. Your last mail message was convenient for an example.

(recevied mail header):

>From hao!woods Mon Feb 8 11:23:25 1988
Date: Mon, 8 Feb 88 11:18:56 MST
From: woods at hao.UCAR.EDU (Greg Woods)
....rest of header and message.....

(when trying to reply back)

>From carris Mon Feb  8 13:08:11 1988
Date: Mon, 8 Feb 88 13:08:06 mst
From: MAILER-DAEMON (Mail Delivery Subsystem)
Subject: Returned mail: Host unknown
To: carris
Status: R

   ----- Transcript of session follows -----
421 hao.tcplocal... Deferred: Address already in use
550 woods at hao.UCAR.EDU... Host unknown: Address already in use

   ----- Unsent message follows -----
Received: by dinl.local (1.2/Ultrix2.0-B)
	id AA01254; Mon, 8 Feb 88 13:08:06 mst
Date: Mon, 8 Feb 88 13:08:06 mst
From: carris (John P. Carris)
To: woods at hao.UCAR.EDU
Subject: Re:  How's it going?

........(rest of message)........

I can SEND mail to this site via an address of the form woods at hao.uucp without
any problem. This form will not work with sites more than one hop away. For
sites more than one hop away, the form hao!foobar!gizmo... must be used.
This presents problems for USENET users when trying to reply to news articles.
Error messages similar to the above are received. Below is a copy of my
sendmail.cf file. The CV, DR, DF, and DZ macros are used with 'hao' as the
target site. I have called DEC telephone support to no avail. They said that
there is no reason it shouldn't work, since they tried it between other ULTRIX
machines without problems. As a result, they wouldn't consider the problem
any further.  This is a MicroVAX II running ULTRIX-32 Version 2.0.
Any help is greatly appreciated. Thanx in advance...

John Carris		email: hao!dinl!carris

############################################################
############################################################
#####
#####		SENDMAIL CONFIGURATION FILE
#####
#		@(#)generic.mc	1.2	(ULTRIX)	1/29/87
#
#####		generic configuration
#####
#####
############################################################
############################################################



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

# This section specifies data about your environment and how to
# handle mail. The configuration has provisions for several (independent)
# mail relay machines for handling different kinds of mail.
# Below these are all given the name "RELAY". If you need or want this
# kind of relay you will need to uncomment the line and put in the name
# of the appropriate host.
#
# The relay machines are specified separately for each kind of mail
# so you can spread out the load. On the other hand they could all
# point to the same machine to centralize information. The relay can
# even name this machine and the "right thing" will happen. When adding
# relay names, be sure to put the first name directly next to the
# name of the macro or class - do not put a space between it. Also, remember
# to uncomment it by removing the pound sign "#".
# For example, the general purpose relay example is given as:
#
#	start of line ->#DRRELAY
#
# To make "foo" your general purpose relay, change the line to:
#
#	start of line ->DRfoo
# 
CVhao

# The $w macro is preset by sendmail to the current host's
# name. Here we simply capture the value in our own $A macro.
#
DA$w
#
# The $D macro will be the domain for this machine. If your machine
# is part of a registered domain, that name should be defined here.
# If you don't have a domain, leave it defined as "local". Some typical
# domains are DEC.COM, ARPA, MIT.EDU, CSS.GOV.
#
DDlocal
#
# These are other "domains" in which this machine may be named. They
# are used to recognize all forms of name for the local machine.
#
CDlocal uucp dnet
#
# The $j macro is the name presented to remote SMTP servers when
# establishing a mail connection. It should always be your fully
# qualified domain name.
#
Dj$w.$D
#
# The $U macro is the name of this machine for UUCP communications.
# It is usually the same as the normal host name, but may need to be
# different for political reasons.
#
DU$w
#
# The $S class can be used to identify "local" machines. Mail to these
# machines will include the sender's and receiver's host names but will
# omit the domain in order to reduce the visual clutter. Mail delivered
# by SMTP to other (non-local) hosts will use full qualification.
#
# If your /etc/hosts file contains only local hosts, you can read the names
# directly from /etc/hosts. Otherwise you should produce a separate list
# of local host names in /usr/lib/hosts.local. Both forms are shown below.
#
#FS/usr/lib/hosts.local
#FS/etc/hosts %*[0-9.]%s
#
# The $R macro is the name of your general purpose relay machine. Any
# mail that cannot be resolved locally is forwarded to this machine
# for processing. It gets anything not covered by the other relay hosts.
#
DRhao
#
# The $F macro and class defines a named list of hosts and a relay machine
# to handle their mail. This is not normally used, but is included in the
# rewrite rules in case the need should arise.
#
#DFRELAY
#CFred blue green
#
# The $E macro is the relay host for dnet (DECNET) connections.
# You need this only if your machine is not running DECNET but depending
# on some other local machine to relay DECNET mail.
#
#DERELAY
#
# The $Z macro names the relay for UUCP mail for sites not directly
# reachable by this host. The list of reachable sites is read from
# the UUCP L.sys file and assigned to the $Z class once when the
# config file is frozen.
#
# *WARNING* You must refreeze the sendmail config file every time
# you add a new host to uucp, or else sendmail will not know about
# it.  If you use uucpsetup to add new hosts, this will be done
# for you automatically - if you add hosts to L.sys by hand, you
# must do it yourself. Type: "/usr/lib/sendmail -bz" as root.
#
DZhao
FZ/usr/lib/uucp/L.sys %[0-9a-zA-Z_-]
#
# The $N macro and class allow you to establish a central site for resolving
# user names which are not known locally. If you use this the relay machine
# will be passed any mail which is not for someone listed in /etc/passwd.
# In particular this means that all alias processing will be passed to the
# relay. You can add additional names to the N class to handle specific local
# aliases such as postmaster.
#
# WARNING: If you use this feature you must refreeze the configuration file
# (via /usr/lib/sendmail -bz) every time a user is added or deleted from
# /etc/passwd. Also you will not be able to establish any local aliases
# other than those listed in class N below.
#
#DNRELAY
#FN/etc/passwd %[0-9a-zA-Z_-]
#CN MAILER-DAEMON postmaster admin
#

############################################################
#
#		@(#)base.m4	1.4	(ULTRIX)	12/16/86	
#
#	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 any specific site.
#
#
############################################################

#		@(#)version.m4	1.4	(ULTRIX)	12/16#################
#  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<@$w.$D>$2			change local info
R$*<$*LOCAL>$*		$:$1<$2$D>$3			change local info
R$*<$+>$*		$1$2$3				defocus
R@$+:$+:$+		@$1,$2:$3			<route-addr> canonical
R@$+:$+			$@<@$1:$2>			route-addr needs <>

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

# Put MAIL-11 back in :: form
R$+@$-.DNET		$2::$1				u at h.dnet => h::u
R$+@$-.$-.DNET		$2.$3::$1			numeric form

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

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

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

# basic textual canonicalization
R$*<$*<$*<$+>$*>$*>$*	$4				3-level <> nesting
R$*<$*<$+>$*>$*		$3				2-level <> nesting
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$=w::$-$+		$2$3				clean off my name
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$+<@$+%$+>		$1%$2<@$3>			move gaze right
R$-!$+<@$~S>		$1!$2@$3			defocus - not local host
R$-::$+<@$~S>		$1::$2@$3			defocus - not local host
R$+<@$+>		$@$>6$1<@$2>			already canonical

# localize mail-11 syntax
R$-::$+			$@$>6$2<@$1.dnet>		host::user
R$-.$-::$+		$@$>6$3<@$1.$2.dnet>		numeric decnet addr

# convert old-style addresses to a domain-based address
R$+%$+			$:$1<@$2>			user%host
R$+<@$+%$+>		$1%$2<@$3>			move "@" right
R$+<@$+>		$@$>6$1<@$2>			now canonical
R$-:$+			$@$>6$2<@$1>			host:user
R$-.$+!$+		$@$>6$3<@$1.$2>			host.domain!user
R$-!$+			$@$>6$2<@$1.UUCP>		resolve uucp names


############################################################
############################################################
#####
#####           local conventions
#
#		@(#)localbase.m4	1.2	(ULTRIX)	12/16/86
#####
#####
#####
############################################################
############################################################

##### special local conversions

# Here you can any special local rewriting rules and keep them all
# in one place. Ruleset 8 is invoked at the beginning of ruleset 3
# and ruleset 6 is invoked at the end. Ruleset 3 always returns
# the result of a call to ruleset 6.

S8
# empty

S6
R$-$+<@$w>		$@$>3$1$2			localhost
R$-$+<@$w.$D>		$@$>3$1$2			localhost
R$-$+<@$w.$=D>		$@$>3$1$2			other local domains
R$+<@$=S>$*		$@$1<@$2.LOCAL>$3		localhost
R$+<@$=S.$D>$*		$@$1<@$2.LOCAL>$3		localhost
R$+<@$=S.$=D>$*		$@$1<@$2.LOCAL>$4		other local domains
R$*<@$+>$*		$@$1<@$2>$3			already ok


############################################################
############################################################
#####
#####		RULESET ZERO PREAMBLE
#####
#####	The beginning of ruleset zero is constant through all
#####	configurations.
#####
#		@(#)zerobase.m4	1.3	(ULTRIX)	10/16/86
#####
############################################################
############################################################

S9
# rerun ruleset 3 and then call 0 again
R$+			$:$>3$1
R$+			$@$>0$1

S0

# first make canonical (necessary for recursion)
#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 at etherhost

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


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


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

# short circuit local hosts
R$*<@$=S.UUCP>$*	$1<@$2.LOCAL>$3			uucp => local
R$*<@$=S.dnet>$*	$1<@$2.LOCAL>$3			dnet => local
R$*<@$=S.$D>$*		$:$1<@$2.LOCAL>$4		domain => local

# if we do not have dnet, send to forwarder
R$+<@$+.dnet>$*		$:$?E$1%$2.dnet<@$E.LOCAL>$3$|$1<@$2.dnet>$3$.

# forward uucp we don't know to primary forwarder
R$*<@$~Z.UUCP>$*	$:$?Z$1%$2.UUCP<@$Z.LOCAL>$3$|$1<@$2.UUCP>$3$.

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

# Undo forwarding if we are forwarder
R$+%$+.$-<@$=w.LOCAL>$*	$1<@$2.$3>$5			if we are forwarder

# resolve names we can handle locally
R$*<@LOCAL>$*		$#local$:$1$2			local

# first handle local network traffic double check that we know the host
#R$*<@$~S.LOCAL>$*	$#error$:Host $2 not connected to $w via tcp
#R$*<@$->$*		$#error$:Host $2 not connected to $w via tcp
R$*<@$-.LOCAL>		$#tcplocal$@$2$:$1<@$2>		user at tcphost.LOCAL
R$*<@$-.LOCAL>$+	$#tcplocal$@$2$:$1<@$2.LOCAL>$3	user at tcphost.LOCAL

# handle dnet stuff
R$+<@$+.dnet>		$#Dmail$@$2$:$1			dnet user

# handle uucp traffic.  double check that we know the host
R$*<@$~Z.UUCP>$*	$#error$:Host $2 not connected to $w via uucp
R<@$+.UUCP>:$+		$1!$2				to old format
R$+<@$+.UUCP>		$2!$1				to old format
R$-!$+			$#uucp$@$1$:$2			host!...

# all other domains try for forwarder, if defined
R$*<@$+.$->$*		$:$?R$1<@$2.$3>$4<@$R>$|$1<@$2.$3>$4$.
R$*<@$+.$->$*<@$=w>	$#tcp$@$2.$3$:$1<@$2.$3>$4	we are forwarder
R$*<@$+.$->$*<@$+>	$#tcplocal$@$5$:$1<@$2.$3>$4	pass it on

# no forwarder, try for tcp connection
R$*<@$+>$*		$#tcp$@$2$:$1<@$2>$3		user at tcphost.domain

# at this point, we are trying a local name.  if we don't
# recognize it, forward to name forwarder host if defined.
R$~N			$:$?N$1<@$N.LOCAL>$|$1$.	not local, redirect
R$*<@$=w.LOCAL>$*	$1				but wait, there's more!
#							we are forwarder, hope
#							it's an alias!
R$*<@$*$-.LOCAL>$*	$#tcplocal$@$3$:$1<@$2$3.LOCAL>$4	let name forwarder do it

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

############################################################
############################################################
#####
#####		Local and Program Mailer specification
#####
#		@(#)localm.m4	1.3	(ULTRIX)	10/16/86
#####
############################################################
############################################################

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

S10
R$+<@LOCAL>		$@$1				delete LOCAL
R$+<@$-.LOCAL>		$@$1<@$2>			delete .LOCAL
R@			$@MAILER-DAEMON			errors to mailer-daemon

############################################################
############################################################
#####
#####		Mail-11 Mailer
#####
#		@(#)xm.m4	1.2	(ULTRIX)	10/16/86
#####
############################################################
############################################################

MDmail,	P=/usr/bin/mail11, F=mnsF, S=17, R=18, A=mail11 $f $x $h $u

S17
R$+			$:$>18$1			preprocess
R$U::$+			$@$U::$1			ready to go
R$+			$@$U::$1			add our name

S18
R$+<@$-.UUCP>		$:$2!$1				back to old style
R$+<@$-.DNET>		$:$2::$1			convert to dnet style
R$+<@$-.LOCAL>		$:$2::$1			convert to dnet style
R$+<@$=S>		$:$2::$1			convert to dnet style
R$+<@$=S.$D>		$:$2::$1			convert to dnet style
R$=S::$+		$2				strip local names
R$$+::$+		$@$1::$2			already qualified
R$+			$@$U::$1			qualify others



############################################################
############################################################
#####
#####		Arpanet TCP Mailer specification
#####
#		@(#)tcpm.m4	1.2	(ULTRIX)	10/16/86
#####
############################################################
############################################################

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

S14

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

# gatewayed to/from DNET
R$+<@$-.DNET>$*	$@$1%$2.dnet<@$A.$D>$3	user at host.DNET

# gatewayed to/from UUCP
R$+<@$-.UUCP>$*		$@$2!$1<@$A.$D>$3		user at host.DNET

# strip local host names if we are forwarder
R$+<@$=S>		$:$1<@$2>$?R<$R>$.		add forwarder
R$+<@$=S.$D>		$:$1<@$2.$3>$?R<$R>$.
R$+<@$+.LOCAL>		$:$1<@$2.LOCAL>$?R<$R>$.

R$+<@$=S><$=w>		$:$1				strip name
R$+<@$=S.$D><$=w>	$:$1
R$+<@$+.LOCAL><$=w>	$:$1
R$+<$R>			$:$1				remove forwarder name

# tack on our name and domain
R$-			$@$1<@$A.$D>			local names
R$+<@LOCAL>		$@$1<@$A.$D>			local names
R$+<@$+.LOCAL>		$@$1<@$2.$D>			local hosts
R$+<@$=S>		$@$1<@$2.$D>			local hosts

S19
# delete domain on local hosts
R$+<@LOCAL>		$@$1
R$+<@$=S>		$@$1<@$2>
R$+<@$=S.$D>		$@$1<@$2>
R$+<@$=S.LOCAL>		$@$1<@$2>
R$+<@$+.$=D>		$@$1<@$2.$3>			leave local domains
R$-			$@$1<@$A>			qualify simple name

# do normal rewrite if all else fails
R$+			$@$>14$1


############################################################
############################################################
#####
#####		UUCP Mailer specification
#####
#		@(#)uucpm.m4	1.3	(ULTRIX)	10/16/86
#####
############################################################
############################################################

# There are two options for the uucp mailer presented here. The only
# difference is the -r option to uux. With the -r option, uucp mail
# will be queued until some other process forces a call to be made.
# Without the -r option, a call will be attempted immediately to
# deliver this message, although the normal uucp rules about when to
# call still apply.
#
# This one just queues the message for a later uucp call.
#Muucp,	P=/usr/bin/uux, F=sDFhuU, S=13, R=23, M=100000,
#	A=uux - -r $h!rmail ($u)
#
# This one attempts a call immediately.
Muucp,	P=/usr/bin/uux, F=sDFhuU, S=13, R=23, M=100000,
	A=uux - $h!rmail ($u)
#
# This mailer lets you pretend to speak uucp to a host with which you have
# an IP/TCP connection. It uses UUCP address rewrite rules with TCP
# message transport. Hosts to be given this treatment must be identified
# by ruleset zero.
Muucptcp,	P=[IPC], F=msDFMhuX, S=13, R=23, M=100000, A=IPC $h

S13
R$+			$:$>23$1			prescan
R$U!$+			$@$U!$1				ready to go
R$+			$@$U!$1				stick on our host name

S23
R$+<@$-.UUCP>		$2!$1				old form
R$+<@$=S>		$1				strip local names
R$+<@$=S.$=D>		$1				strip local names
R$+<@$-.DNET>		$2.dnet!$1			old form
R$+<@$+>		$2!$1				old form
R$=S!$+			$2				strip local name
R$=S.$D!$+		$2				strip local name
R$=S.$=D!$+		$2				strip local name
R$-			$U!$1				stick on our host name



More information about the Comp.unix.wizards mailing list