[comp.unix.ultrix] Help wanted with sendmail routing configuration

mjb@acd4.UUCP ( Mike Bryan ) (09/02/89)

My link to the outside world is a UUCP connection with UUNET
(uunet.uu.net).  Currently, I can get mail to UUNET by using addresses
in the UUCP format (i.e., uunet!host!user).  However, I would like to
have mail with an address like "user@host" automatically routed via
uucp through uunet as well, provided we don't know the host locally.
I set up the config file the way I thought it should work, but my mail
gets bounced (locally) with the follow error (sent to user@host.com):

   ----- Transcript of session follows -----
550 uunet.uucp.tcplocal... 550 Host unknown
550 user@host.com... Host unknown

I have not been able to grok enough of the sendmail configuration to
figure this one out.  Does anyone have any suggestions, or a working
configuration file that I can use as an example?

We are running Ultrix 3.0 on our gateway machine, and a mixture of
Ultrix 2.3 and 3.0 on our other machines.  The mailer is sendmail.
I'm using the basic sendmail.cf as supplied with Ultrix 3.0, with
minor changes to have routing to uunet from our gateway, and routing
to our gateway from other machines.

Any help would be greatly appreciated.  Please contact me via the
address listed below.
-- 
Mike Bryan, Applied Computing Devices, 100 N Campus Dr, Terre Haute IN 47802
Phone: 812/232-6051  FAX: 812/231-5280  Home: 812/232-0815
UUCP: uunet!acd4!mjb  ARPA: acd4!mjb@uunet.uu.net
"Did you make mankind after we made you?" --- XTC, "Dear God"

jeffrey@algor2.algorists.com (Jeffrey Kegler) (09/03/89)

In article <1989Sep1.182826.10492@acd4.UUCP> mjb@acd4.UUCP ( Mike Bryan          ) writes:
>
>My link to the outside world is a UUCP connection with UUNET
>(uunet.uu.net).  Currently, I can get mail to UUNET by using addresses
>in the UUCP format (i.e., uunet!host!user).  However, I would like to
>have mail with an address like "user@host" automatically routed via
>uucp through uunet as well, provided we don't know the host locally.

I am in the same situation and have hacked up a sendmail.cf which
first looks for direct uucp connections, and when it cannot find one,
just bundles the address (be it ever so defective) to uunet, which is
regarded by my sendmail as the one true source of addressing wisdom.
Most of the notportable sections of the following can probably be
found by searching for "algor" case insensitively.  No guarantees.

=== Start of sendmail .cf ===
#
#  Sendmail
#  Copyright (c) 1983  Eric P. Allman
#  Berkeley, California
#
#  Copyright (c) 1983 Regents of the University of California.
#  All rights reserved.  The Berkeley software License Agreement
#  specifies the terms and conditions for redistribution.
#
#	@(#)uucpproto.mc	1.2 (Berkeley) 1/24/89
#	@(#)proto.mc	1.20 (Berkeley) 1/25/89
#
# built by phil on Wed Jan 25 11:48:03 PST 1989
# in /usr/src/local/nettables/sendmail.cf/cf on monet.Berkeley.EDU
#
############################################################
############################################################
#####
#####		SENDMAIL CONFIGURATION FILE
#####
############################################################
############################################################


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

# file containing our internet aliases
Cwalgor2

# uucp hostnames
DUalgor2
CU

# local UUCP connections
CV	uunet

#############################
###   Setup Information   ###
#############################


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

# local domain name
DDALGORISTS.COM









# my official hostname
Dj$w



###############
#   Classes   #
###############

# Internal ("fake") domains that we use in rewriting
CIUUCP BITNET CSNET

CLalgor2 algor2.uu.net algor2.algorists.com


######################
#   Version Number   #
######################

DZ1.34


######################
#   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/$Z ready at $b

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

# location of alias file
OA/usr/lib/aliases
# wait up to ten minutes for alias file rebuild
Oa10
# substitution for space (blank) characters
OB.
# (don't) connect to "expensive" mailers
#Oc
# default delivery mode (deliver in background)
Odinteractive
Oewriteback
Ov
# temporary file mode
OF0600
# default GID
Og1
# location of help file
OH/usr/lib/sendmail.hf
# log level
OL9
# default network name
ONARPA
# 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
OW*
# load average at which we just queue messages
Ox999
# load average at which we refuse connections
OX999

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

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

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

Troot
Tdaemon
Tuucp
Tjeffrey

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

H?P?Return-Path: <$g>
HReceived: $?sfrom $s $.by $j ($v/$Z)
	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

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



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

R@			$@				handle <> error addr

# resolve numeric addresses to name if possible
R$*<@[$+]>$*		$:$1<@$[[$2]$]>$3		lookup numeric internet addr

# externalize local domain 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
R$+%$=w@$=w		$1@$w				u%host@host => u@host
R$+%$=w@$=w.$D		$1@$w				u%host@host => u@host


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

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

# basic textual canonicalization -- note RFC733 heuristic here
R$*<$*<$*<$+>$*>$*>$*	$4				3-level <> nesting
R$*<$*<$+>$*>$*		$3				2-level <> nesting
R$*<$+>$*		$2				basic RFC821/822 parsing

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

# localize and dispose of route-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;			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$+^$+			$1!$2				convert ^ to !
R$-!$+			$@$>6$2<@$1.UUCP>		resolve uucp names
R$+.$-!$+		$@$>6$3<@$1.$2>			domain uucps
R$+!$+			$@$>6$2<@$1.UUCP>		uucp subdomains
R$+%$+			$:$>9$1%$2			user%host
R$+<@$+>		$@$>6$1<@$2>			already canonical
R$-.$+			$@$>6$2<@$1>			host.user


#################################
#   special local conversions   #
#################################

S6
R$*<@$=w>$*		$:$1<@$w>$3			get into u@$w form
R$*<@$=w.$D>$*		$:$1<@$w>$3
R$*<@$=U.UUCP>$*	$:$1<@$w>$3

################################
#   Change rightmost % to @.   #
################################

S9
R$*%$*			$1@$2				First make them all @'s.
R$*@$*@$*		$1%$2@$3			Undo all but the last.
R$*@$*			$@$1<@$2>			Put back the brackets.



###################
###   Mailers   ###
###################


############################################################
############################################################
#####
#####		Local and Program Mailer specification
#####
############################################################
############################################################

Mlocal, P=/usr/bin/lmail, F=CDFPMlms, S=10, R=20, A=lmail -f $g $u
Mprog,	P=/bin/sh,   F=lsDFMe,   S=10, R=20, A=sh -c $u

S10
R@			$n			errors to mailer-daemon


############################################################
############################################################
#####
#####		UUCP Mailer specification
#####
############################################################
############################################################


Muucp,	P=/usr/bin/uux, F=DFMhuU, S=13, R=23, M=100000,
	A=uux - -z -x9 -a$f -gZ $h!rmail ($u)

S13
R$+			$:$>5$1				convert to old style
R$*<@$=w>$*		$1<@$w>$2			resolve abbreviations
R$*<@$->$*		$1<@$2.$D>$3			resolve abbreviations
R$+<@$+>		$2!$1				uucpize (no @'s in addr)
R$w!$+			$1				strip local name
R$+			$:$U!$1				stick on our host name
R$=U!$-%$-		$:$1!$2@$3.$D			ucbvax!user@host.domain

S23
R$+			$:$>5$1				convert to old style
R$*<@$=w>$*		$1<@$w>$2			resolve abbreviations
R$*<@$->$*		$1<@$2.$D>$3			resolve abbreviations
R$+<@$w>		$U!$1				a!b@here -> here!a!b
R$=U!$+			$2				here!a!b -> a!b
# sanity ... should not happen.
R$=U.$D!$+		$2				strip local name.domain


############################################################
############################################################
#####
#####		Provide Backward Compatibility
#####
############################################################
############################################################

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

R$+<@$w>		$1				strip host
R$+<@$-.UUCP>		$2!$1				u@host.UUCP => host!u



#####################
###   Rule Zero   ###
#####################


############################################################
############################################################
#####
#####		RULESET ZERO PREAMBLE
#####
#####	The beginning of ruleset zero is constant through all
#####	configurations.
#####
############################################################
############################################################

S0

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

# handle special cases
R$*<@[$+]>$*		$:$1<@$[[$2]$]>$3		numeric internet addr
# R$*<@[$+]>$*		$#tcp$@[$2]$:$1@[$2]$3		numeric internet spec
R$+			$:$>6$1
R$-<@$w>		$#local$:$1
R@			$#error$:Invalid address	handle <> form

# canonicalize using the nameserver if not internal domain
R$*<@$*.$~I>$*		$:$1<@$[$2.$3$]>$4
R$*<@$->$*		$:$1<@$[$2$]>$3
R$*<@$->$*		$:$1<@$2.$D>$3			if nameserver fails

# now delete the local info
R<@$w>:$*		$@$>0$1				@here:... -> ...
R$*<@$w>		$@$>0$1				...@here -> ...

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


###############################################
###   Machine dependent part of Rule Zero   ###
###############################################



# resolve local UUCP connections
R$=V!$+			$#uucp$@$1$:$2			host!whatever
R<@$=V.UUCP>:$+		$#uucp$@$1$:$2			@host.UUCP:...
R$+<@$=V.UUCP>		$#uucp$@$2$:$1			user@host.UUCP

# look for local names
R<@algor2.uu.net>:$+		$#local$@$2$:$2		@host.UUCP:...
R$+<@algor2.uu.net>		$#local$@$2$:$1		user@host.UUCP
R<@algor2.algorists.com>:$+	$#local$@$1$:$2		@host.UUCP:...
R$+<@algor2.algorists.com>	$#local$@$2$:$1		user@host.UUCP
R$-				$#local$:$1		everything else

# most everything else goes to uunet
R$+<@$+>		$#uucp$@uunet$:$2!$1		everything else
R<@$+>:$+		$#uucp$@uunet$:$1!$2		everything else

R$+			$#local$:$1			everything else

=== End of sendmail.cf ===
-- 

Jeffrey Kegler, Independent UNIX Consultant, Algorists, Inc.
jeffrey@algor2.ALGORISTS.COM or uunet!algor2!jeffrey
1762 Wainwright DR, Reston VA 22090