[net.mail] Sendmail problems - HELP!

clewis@mnetor.UUCP (Chris Lewis) (03/22/85)

We are having some problems with our mail system, and I was wondering
if anybody could help.  I am trying to read the sendmail documentation
(we're running BSD4.2 on a Pyramid) and it refers to RFC819.  Does anybody
have a mailable version of this?  If so, could they send e-mail to me
about having it and I will ask the closest person to send the actual
document.

The basic problem is this: We (mnetor) are basically a UUCP only site.
We talk to utcs via UUCP and utcsri talks to them (I'm not sure how,
probably an ethernet).  If I send a piece of mail:
	Mail utcs!utcsri!someoneA utcs!utcsri!someoneB utcs!someoneC someoneD
and someoneA replies to the message, the return addresses get ARPAized
(utcsri is also on ARPA) into this:
	From utcs!someoneA@utcsri Thu Mar 21 13:48:47 1985
	Received: by mnetor.UUCP (4.12/4.7)
		id AA20487; Thu, 21 Mar 85 13:48:46 est
	Date: Thu, 21 Mar 85 13:48:46 est
	Received: from utcsri.UUCP (utcsri.ARPA) by utcs.UUCP (4.24/4.7) id AA12794; Thu, 21 Mar 85 13:21:59 est
	Return-Path: <someoneA@utcsri>
	Received: by utcsri.UUCP (4.24/4.7)
		id AA20019; Thu, 21 Mar 85 13:20:28 est
	From: utcs!someoneA@utcsri (SomeoneA's name)
	To: someoneC@utcs, mnetor!clewis@utcs
	Subject: Re:  A Problem
	Cc: mnetor!someoneD@utcs, utcsri!someoneB@utcs
	Status: RO

If I try to reply to this, all of the addresses fail (utcsri!someoneB@utcs
via an "unknown host", "someoneC@utcs" via "unknown user" (I can figger
out how to fix the latter one, but am not convinced that I should).  Note that
the "From" and the utcsri!someoneB@utcs are inconsistent.  Anyhow, I'm
not even sure which sendmail is causing the problem (there are three
involved).  However, shouldn't utcsri use UUCP conventions while going
down an entirely UUCP path?  Eg: all of the paths will be with '!'?
I have been speaking to some of the mail admins on these machines and
they seem to think that it is working as intended.  Also, that the
"cc:" budger-up is a known-unfixable clash between "!" and "@".
utcsri seems to be the only site where this shows up.

I am mostly a novice at sendmail and was hoping someone can send me
something clearer than the Sendmail documents about what our sendmail 
should be doing.  I am also pursuing this off-net.

Thanks,
-- 
Chris Lewis, Motorola New Enterprises
UUCP: {allegra, linus, ihnp4}!utzoo!utcs!mnetor!clewis
BELL: (416)-475-1300 ext. 321

bukys@rochester.UUCP (Liudvikas Bukys) (03/26/85)

Once, when I got tired of all the strange things my uucp-only neighbors
would do to their addresses, I wrote a very stripped sendmail
configuration file.  *It is only useful to uucp-only sites.*  It
doesn't even '@' as special.

Various versions of this have been in use in 3 or 4 of my uucp-only
neighbors for over a year.

Before anybody starts complaining that it is "wrong", in that it
doesn't pass RFC822 around between systems, and doesn't even parse
RFC822 addresses, let me just say that I already know.  However,
probably every sendmail configuration file around is "wrong" in some
way.  They all rewrite addresses (when they shouldn't).  Most of them
do not parse route-addresses right (they should).  And so on...

Meanwhile, here is a configuration file which behaves no worse than any
I've seen, and is simple and relatively comprehensible.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
				- cut here -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

############################################################
############################################################
#####
#####		SENDMAIL CONFIGURATION FILE
#####
#####	uucpeasy.cf -- reasonable uucp-only prototype
#####
##### Liudvikas Bukys
##### rochester!bukys (uucp) via allegra, decvax, seismo
##### bukys@rochester (arpa)
##### 26-Mar-85
#####
############################################################
############################################################


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

# domain
# if your uucp name is different from `hostname`, put it here instead of $w.
# (or if your uucp name has a prefix (like "ur-") but your `hostname` doesn't,
#  stick that prefix in front of the $w.)
DD$w
CD

# version
DVeasy-2.2


##########################
###   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)$.
# my official hostname
Dj$D.UUCP
# SMTP login message
De$j Sendmail $v/$V ready at $b

###################
###   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
OF0640
# default GID
Og1
# location of help file
OH/usr/lib/sendmail.hf
# ignore dots in messages
Oi
# 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
# wizard's password
OWa/FjIfuGKXyc2

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

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

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

Troot
Tdaemon
Tuucp

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

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

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


################################
#  Sender Field Pre-rewriting  #
################################
S1

###################################
#  Recipient Field Pre-rewriting  #
###################################
S2

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

###########################
#  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				convert ^ to !
R$D!$+			$1				strip local host

########################
#  Address Resolution  #
########################
S0

# first make canonical
R$+			$:$>3$1				make canonical

# handle special cases.....
R@			$#local$:MAILER-DAEMON		handle <> form
R$+!$+			$#uucp$@$1$:$2			handle site!user
R$*			$#local$:$1			handle anything else


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

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

S10
R@			MAILER-DAEMON			errors to mailer-daemon

S20


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

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

S13
R$*			$:$D!$1				prepend my host

S23

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
				- cut here -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Liudvikas Bukys
rochester!bukys (uucp) via allegra, decvax, seismo
bukys@rochester (arpa)

hokey@plus5.UUCP (Hokey) (03/31/85)

In article <325@mnetor.UUCP> clewis@mnetor.UUCP (Chris Lewis) writes:
>If I send a piece of mail:
	Mail utcs!utcsri!someoneA utcs!utcsri!someoneB utcs!someoneC someoneD
>and someoneA replies to the message, the return addresses get ARPAized
>(utcsri is also on ARPA) into this:
	From utcs!someoneA@utcsri Thu Mar 21 13:48:47 1985
	Return-Path: <someoneA@utcsri>
	From: utcs!someoneA@utcsri (SomeoneA's name)
	To: someoneC@utcs, mnetor!clewis@utcs
	Cc: mnetor!someoneD@utcs, utcsri!someoneB@utcs

I believe the problem is that utcsri is treating the message between UUCP
and ARPA as a bridge does, when it should be treating messages as a gateway.
(A bridge simply passes data without translation.)

I can't blame the folks at utcsri.  I recently attacked this problem in
a major way, and decided that it was probably unsolvable at many places
without an edge database of sufficient mail sites on at least one of the
nets in question.  (Several people know the degree to which I gloss over
this point.)

Furthermore, I believe sendmail is not suitable for use in UUCP land,
because of the way >From lines are tied to From: lines, the lack of .cf-file
level control of outgoing message headers (the U mailer flag format is
hardcoded), attempts to properly qualify local recipients seems doomed
to failure ($u seems to get rewritten instead of just the recipient)
(which causes the local mailer to blow up), and there is no easy way to
handle an arbitrary domain spec.  Also, *every* address must be translated
at gateway sites to conform to the routing and addressing requirements
of the "new" protocol.  I have never been able to get sendmail to do this.
The problem is exacerbated by the route oriented nature of UUCP land,
which makes it very difficult to properly qualify the sender and recipients
at gateway sites.  I almost forgot - it is fun dealing with:

	From: Firstname Lastname (comment phrase) <site!user>

or some such construct with a "regular" unix mailer.

I don't doubt that several of my complaints are due to my ignorance.  I
discussed several issues pertaining to .cf files and sendmail's behavior
with J. Gilmore (sun!gnu), and he indicated that after 3 years of hacking
sendmail, he feels pretty good.  This is all well and good, but I don't
think one should have to spend much time at all to make this stuff work.

Lest people infer that I disapprove of Eric Allman's work, I'd like to
state that the man must be a genius.  Sendmail is great for true internet
mail communication.  The problems show up when sendmail is used in
different networks with different mail protocols.

When I finish all my hacking, I will be posting the .cf files I use for
uucp sites.  I have drawn from *many* sources.

Who knows?  Who cares?  Why bother?  It just doesn't matter.
-- 
Hokey           ..ihnp4!plus5!hokey
		  314-725-9492

mendell@utai.UUCP (Mark Mendell) (04/01/85)

As the person who wrote (hacked?) the sendmail.cf files for utcsri (and
most of the other machines here), I will agree that it is very painful to
handle both UUCP & ARPA style addresses.  We support uucpsystem!...!user,
user@ethersystem, and for backwards compatability ethersystem!user.  In
addition, we also have a CSNET connection to worry about.  I have munged
the distributed sendmail.cf files until it works most of the time, and
send all complaints to /dev/null (or challenge the complainer to do better).

    The basic algorithm is:

    - if the path is knownUUCPsite!anything, send it to that UUCP site.

    - if the path is anything@CSNETsite, send it to CSNET

    - if the path is anything@AnySite, send it to AnySite

    - if the path is anything!anythingElse, send it to anything & let them
	worry about it.

    - otherwise, we have a local name

    L.sys and CSNET site names are read in at freeze time.

    I wouldn't mind hearing about better algorithms.  We had a problem with
conflicts between CSNET names & local network nicnames, that caused some mail
to be sent to Amsterdam for a couple of days.  I came up with a shell script
that munges the CSNET name file until it doesn't conflict.
-- 
Mark Mendell
	    Computer Systems Research Institute    University of Toronto
	    Usenet:	{linus, ihnp4, allegra, decvax, floyd}!utcsrgv!mendell
	    CSNET:	mendell@Toronto
	    ARPA:	mendell%Toronto@CSNet-Relay

brian@sdcc3.UUCP (Brian Kantor) (04/03/85)

>     I wouldn't mind hearing about better algorithms.  We had a problem with
> conflicts between CSNET names & local network nicnames, that caused some mail
> to be sent to Amsterdam for a couple of days.  I came up with a shell script
> that munges the CSNET name file until it doesn't conflict.

What I finally wound up doing for UCSD was modifying a copy of the
Berkeley sendmail.cf files.  How it works is:

	First, any address of the form  a!b  is transformed into
	b@a.uucp.  This applies to an address having more than one bang
	in it, so that a!b!c!d becomes b!c!d@a.uucp.

	a@b.bitnet  becomes  a%b.bitnet@wiscvm.arpa

	a@b.csnet   becomes  a%b.csnet@csnet-relay.arpa

	a@b.dec     becomes  a%b.dec@decwrl.arpa

	a@b  has the local domain tacked onto it (later removed) so that
	for a while, it becomes  a@b.local

	Any address of the form  a@b.domain  is unmodified.

	If the domain is arpa (as in a@b.arpa) or milnet (soon to be
	EDU, COM, GOV, and others), its sent to the tcp mailer for
	delivery over the internet.

	If the domain is uucp, its transformed from b@a.uucp back into a
	banged address a!b and given to uucp to deliver.

	Finally, the host part (b of a@b.local) is examined to see if the
	host is a local one on the ethernet.  If so, its sent by the
	ethernet mailer.  Otherwise, the default is to strip off the
	.local domain, and its given to the tcp mailer for internet
	delivery.

This doesn't solve all our problems.  But it works quite well for almost
all of our mail, and we're constantly improving it as we run into new
and more interesting addresses.

There's a bunch of other code in there to hide local non-registered
hosts from the internet, and to send mail to VMS systems using the
Wollongong TCP/IP server, and the like.

If you'd seriously like a copy (its BIG!!!) of the sendmail.cf file, I
can send it to you.  Or maybe I'll post it to here or net.sources if
enough people want it.  As I say, its got bugs in it, but it does run.

	Brian Kantor	UC San Diego

	decvax\ 	brian@ucsd.arpa
	akgua  >---  sdcsvax  --- brian
	ucbvax/		Kantor@Nosc 

``You unlock this door with the key of imagination...''

spaf@gatech.CSNET (Gene Spafford) (04/20/85)

I thought I'd throw my comments into this discussion.

My sendmail files support input addresses in any of the following
formats:
	name@site
	site!name
	name%site
	site^name	(backwards compatability)
	site:name	(ditto)

Each may (optionally) specify a domain and/or comments.

All the addresses first get rewritten as name@site, preserving
any given domain.

Next, if the domain is one of a sequence I know about (UUCP, ARPA, CSNET,
DEC, BITNET, MAILNET, GTNET, LOCAL) then I rewrite the address
according to the rules for that network and forward it on (to the site,
or to the gateway).
For example, if I get an address (from a local site) of the form:
	person@site.bitnet
it ends up being sent to:
	person%site.BITNET@wiscvm.ARPA

If the sitename is not given a specific domain name, then it is compared
against site name lists for the following groups, in this order:
	local GTNET sites (via SMTP)
	local UUCP sites (1 hop away)
	all CSNET hosts
	all UUCP hosts
	all ARPA hosts
	all BITNET hosts
	DEC E-net hosts I know about (I don't have a complete list)

a match at any point appends the proper domain to the address, and the
process is reiterated.  Any address which falls through the whole
process is treated as an error, and mailed back with an
"unknown host or domain" error.

I'll be happy to send copies of the configuration files to anyone
interested.  We have connections to UUCP and CSNET, plus 5 sites
on a shared Ethernet, so I can't say that any bizarre changes
to support ARPA are easy or known to work in this environment.
-- 
Gene "4 months and counting" Spafford
The Clouds Project, School of ICS, Georgia Tech, Atlanta GA 30332
CSNet:	Spaf @ GATech		ARPA:	Spaf%GATech.CSNet @ CSNet-Relay.ARPA
uucp:	...!{akgua,allegra,hplabs,ihnp4,linus,seismo,ulysses}!gatech!spaf

spaf@gatech.CSNET (Gene Spafford) (04/24/85)

I have gotten a flood of responses to my offer to post our sendmail
macros.  I have tried to respond by mail to every request I received up
to yesterday noon, but some addresses don't work as advertised, or
maybe it is just that the mailer doesn't want to handle the file (it is
32K; I put together a "shar" file).  Additionally, the number of
requests is growing considerably.

Whatever.

I'm going to submit it to mod.sources so you can all get a crack at it
that way.  If it doesn't show up your news in a week or so, write to me
again and we'll see what we can do.

If you find anything that might be considered as a correction or
enhancement to my files, please let me know about it.  I will try
to share such comments with everyone here.  Additionally, I will
try to answer questions about how/why certain parts work the way 
they do -- BY MAIL.


Note to people who got copies in the mail:  I screwed up by trying to
put some last minute documentation into the files, and the initial
version (large "shar" file) had incorrect versions of "uucpm.m4" and
"uumail.m4".  I sent a correct to some people, but as usual in
situations like this, the correction was wrong.  I sent out a second,
correct set after that.  The correct versions will be posted to
mod.sources and each has RCS revision number 4.3.

-- 
Gene "4 months and counting" Spafford
The Clouds Project, School of ICS, Georgia Tech, Atlanta GA 30332
CSNet:	Spaf @ GATech		ARPA:	Spaf%GATech.CSNet @ CSNet-Relay.ARPA
uucp:	...!{akgua,allegra,hplabs,ihnp4,linus,seismo,ulysses}!gatech!spaf