[comp.unix.admin] sendmail shock. Bibliography?

pa@appmag.com (Pierre Asselin) (04/02/91)

The title pretty much says it.  I'm a new Unix sysadmin  and  I'm
going  to have to hack sendmail.cf real soon now.  I can read man
pages, but in this case I need a book to  get  started.   I  want
technical information, not generalities:

    -all the networks and internetwork address formats known to man,
    -what will sendmail do for me anyway,
    -how do I get it to do my bidding,
    -what lower-level services does it use.

And on top of it, the book should define each term before the first use.
Anyone know of such a beast ?  Help.

  --Pierre Asselin, R&D, Applied Magnetics Corp.  I speak for me.

gary@sci34hub.sci.com (Gary Heston) (04/03/91)

In article <1991Apr1.173622.12281@appmag.com> pa@appmag.com (Pierre Asselin) writes:
>The title pretty much says it.  I'm a new Unix sysadmin  and  I'm
>going  to have to hack sendmail.cf real soon now.  I can read man
>pages, but in this case I need a book to  get  started.

Forget it. Unless you grew up with sendmail, you'll probably never
figure it out. 

Get smail3 off uunet, and convert to that. Understandable, works well,
and has readable config files.

-- 
Gary Heston   System Mismanager and technoflunky   uunet!sci34hub!gary or
My opinions, not theirs.    SCI Systems, Inc.       gary@sci34hub.sci.com
I support drug testing. I believe every public official should be given a
shot of sodium pentathol and ask "Which laws have you broken this week?".

jik@athena.mit.edu (Jonathan I. Kamens) (04/04/91)

In article <1991Apr2.180215.1356@sci34hub.sci.com>, gary@sci34hub.sci.com (Gary Heston) writes:
|> In article <1991Apr1.173622.12281@appmag.com> pa@appmag.com (Pierre Asselin) writes:
|> >The title pretty much says it.  I'm a new Unix sysadmin  and  I'm
|> >going  to have to hack sendmail.cf real soon now.  I can read man
|> >pages, but in this case I need a book to  get  started.
|> 
|> Forget it. Unless you grew up with sendmail, you'll probably never
|> figure it out. 

  Well, I've only been using it for a couple years on and off, and I think I
understand it pretty thoroughly, enough that I am able to maintain my own
config file on my workstation.

  The only documentation I've ever seen is the stuff in
/usr/doc/smm/07.sendmailop.  The sendmail man page and ease were also helpful.
And I've looked at a lot of sendmail.cf files.  I've also seen a few heavily
commented sendmail.cf files.

  I don't even know if there *are* any books about sendmail.  Perhaps if there
were one, sendmail would become more accepted, and that's the last thing we
want to happen :-).

|> Get smail3 off uunet, and convert to that. Understandable, works well,
|> and has readable config files.

  I've never used this, so I don't know if it's easier to configure than
sendmail, or as powerful, or whatever.  I guess if it does the job, though,
it's as good a tool as sendmail or any other.  Perhaps better.  But don't
dismiss sendmail out-of-hand.

  Wasn't the FSF working on a mailer at one point?  Whatever happened with
that?  Anybody know?

-- 
Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik@Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8085			      Home: 617-782-0710

barnett@grymoire.crd.ge.com (Bruce Barnett) (04/04/91)

In article <1991Apr2.180215.1356@sci34hub.sci.com> gary@sci34hub.sci.com (Gary Heston) writes:
>   Forget it. Unless you grew up with sendmail, you'll probably never
>   figure it out. 

>   Get smail3 off uunet, and convert to that. Understandable, works well,
>   and has readable config files.

Or you can get Ease 3.1 - which is a higher level language for
sendmail files. Ease does not replace sendmail. You convert
sendmail.cf files into Ease, edit them (with real variable names,
keywords, preprocessor support, etc.) Then convert them back into
sendmail.

Instead of 
---
R$*<@$*$=m>$*		$1<@$2LOCAL>$4			convert local domain
R$-!$+			$@$>6$2<@$1.uucp>		uucphost!user
---
You see
---
	if ( zero_or_more <@ zero_or_more  any_in_mydomainname > zero_or_more )	/* convert local domain */
		retry ($1<@$2"LOCAL">$4);
	if ( exactly_one ! one_or_more )	/* uucphost!user */
		return (RULESET_6 ($2<@$1."uucp">));
---
So you see, you can't knock sendmail anymore because of the syntax,
you have to pick a better reason. :-)

Ease 3.1 is available from the alt.sources archives.
Soon to be released to comp.sources

If you REALLY need it, send me mail.
--
Bruce G. Barnett	barnett@crdgw1.ge.com	uunet!crdgw1!barnett

emv@ox.com (Ed Vielmetti) (04/04/91)

In article <1991Apr1.173622.12281@appmag.com> pa@appmag.com (Pierre Asselin) writes:

   The title pretty much says it.  I'm a new Unix sysadmin  and  I'm
   going  to have to hack sendmail.cf real soon now.  I can read man
   pages, but in this case I need a book to  get  started.   I  want
   technical information, not generalities:

If your mailer situation is simple enough (no oddball dec-20's to code
around, no vms gatewaying, connnections to not very many other sites)
and your load is not too enormous, then smail 3 is quite a reasonable
alternative to sendmail.  

configurations can be mercifully short and uncryptic.  adding and
subtracting ways of doing things is broken down reasonably well so
that you can make a change here without having to reconstruct the
entire configuratino.

If you don't already have a working sendmail configuration, I see no
reason to go and try to create one now.

-- 
 Msen	Edward Vielmetti
/|---	moderator, comp.archives
	emv@msen.com

"With all of the attention and publicity focused on gigabit networks,
not much notice has been given to small and largely unfunded research
efforts which are studying innovative approaches for dealing with
technical issues within the constraints of economic science."  
							RFC 1216

schwartz@groucho.cs.psu.edu (Scott Schwartz) (04/04/91)

barnett@grymoire.crd.ge.com (Bruce Barnett) writes:
   gary@sci34hub.sci.com (Gary Heston) writes:
   >   Forget it. Unless you grew up with sendmail, you'll probably never
   >   figure it out. 
   >   Get smail3 off uunet, and convert to that. Understandable, works well,
   >   and has readable config files.

   Or you can get Ease 3.1 - which is a higher level language for
   sendmail files. Ease does not replace sendmail. 

Sendmail is ++ungood.

My experience has been that Ease is not much better than sendmail,
especially considering that the alternatives are so much better.

The mailer of choice around these parts is Zmailer, by Rayan
Zacharaissen <rayan@ai.toronto.edu>.  It is understandable, works
well, has readable config files, and it is designed to scale well.

barnett@grymoire.crd.ge.com (Bruce Barnett) (04/04/91)

In article <uf3Gv1qg1@cs.psu.edu> schwartz@groucho.cs.psu.edu (Scott Schwartz) writes:


>   My experience has been that Ease is not much better than sendmail,
>   especially considering that the alternatives are so much better.

Ease doesn't give you anything more than sendmail does. Except
an easier to read file, perhaps.

>   The mailer of choice around these parts is Zmailer, by Rayan
>   Zacharaissen <rayan@ai.toronto.edu>.  It is understandable, works
>   well, has readable config files, and it is designed to scale well.

I know little about smail3 or Zmailer. However, I have 246 different
addresses in my mail address test suite that have to be properly
handled. One feature I need is the ability to re-write broken,
brain-damaged addresses. 

Some GE sites have extreme difficulty generating the correct address,
especially when they use UUCP and DECNET to forward mail to our
gateway. I have to re-write the addresses into proper form. This
includes machines providing the wrong domain address.  I also have to
rewrite internet addresses into the proper form when I forward it to
sites with limited delivery agents, like DECNET, UUCP, and SMTP servers.

In other words, instead of telling other sites that their system
should have smarter mail delivery agents, I Make It Work with
Sendmail.

Example: There is one machine who is in domain "XYZ", who insists on
re-writing their address into the form

	user@XYZ.com.user@anything.arpa

I can take that address and write it into the correct *.XYZ.ge.com
address.

Can smail3 or Zmailer do these things? Can anyone give examples?
IMHO, the problem with sendmail is not the syntax (esp. with Ease), it
is understanding EVERY POSSIBLE MAIL ADDRESS VARIATION, and HOW TO
DEAL WITH IT CORRECTLY.

Any delivery agent that can solve those sorts of problems will be
complex. It's not the fault of the MDA, it's because the problem is complex.

Switching to tools other than sendmail will not make the problem go away.
--
Bruce G. Barnett	barnett@crdgw1.ge.com	uunet!crdgw1!barnett

peter@ficc.ferranti.com (Peter da Silva) (04/05/91)

In article <1991Apr3.202552.20907@athena.mit.edu> jik@athena.mit.edu (Jonathan I. Kamens) writes:
>   Wasn't the FSF working on a mailer at one point?  Whatever happened with
> that?  Anybody know?

Well, smail 3.1 is under the GPL, so that's probably what happened to it.
The confusing thing is that smail 2.5 and smail 3.1 are completely different
programs with not an atom of code in common. :-<
-- 
Peter da Silva.  `-_-'  peter@ferranti.com
+1 713 274 5180.  'U`  "Have you hugged your wolf today?"

dnsurber@lescsse.jsc.nasa.gov (Douglas Surber) (04/05/91)

In <BARNETT.91Apr4091419@grymoire.crd.ge.com> barnett@grymoire.crd.ge.com (Bruce Barnett) writes:

>Can smail3 or Zmailer do these things? Can anyone give examples?
>IMHO, the problem with sendmail is not the syntax (esp. with Ease), it
>is understanding EVERY POSSIBLE MAIL ADDRESS VARIATION, and HOW TO
>DEAL WITH IT CORRECTLY.

>Any delivery agent that can solve those sorts of problems will be
>complex. It's not the fault of the MDA, it's because the problem is complex.

>Switching to tools other than sendmail will not make the problem go away.

I was recently "volunteered" to take over maintaining the mail system at
my site.  Having no prior experience, I have had *Lots*Of*Fun*.

My difficulties arrise not from the sendmail program, which goes about
its job in a workman like way, nor the cf file syntax, which is a kluge
but readable with some effort, but with the actual cf file itself.
I can read any one rule and tell what it does in a low level sense, but
I have no idea why it does it, nor do I have sufficient MIPS in my head
to figure out what the larger rule sets do even in the low level sense.

The comments are cryptic when present and usually not even that.  According
to the previous administrator, the cf file is mostly the standard BSD
file with a few tweeks for our site.  He said he didn't really know what
a lot of it did or why it was there; I don't really understand what any
significant part of it does in detail or why it's there.

What would be really great would be if one or more of you gurus would help
those of us who who don't have your knowledge by creating one or two good
generic cf files--one for domain sites and one for UUCP sites, maybe one
that does both.  Document the hell out of it.  Describe what each rule
set does, both in terms of low level text manipulation and at a higher
level, why it does it.  Same for each rule in the rule set.  Document 
which classes and macros to mung and how, to localize the file.  And
leave out all of the Berkeley specific crud.  If I understand what the 
silly thing is doing in the first place, I am confident that I can fix any
breakage at my local site.

I know this would be a lot of work.  I know you won't get paid for it.
But a lot of us would be really greatful and would name our children
after you.

--
Douglas Surber                 Internet: dnsurber@jsc.nasa.gov
Lockheed                       NASAmail: dnsurber/jsc/nasa
Houston, Texas                 Phone:    713-283-5195
Life can be only understood backwards, but it must be lived forwards.

kjj@varese.UUCP (Kevin Johnson) (04/05/91)

In article <uf3Gv1qg1@cs.psu.edu> schwartz@groucho.cs.psu.edu (Scott Schwartz) writes:
>
>barnett@grymoire.crd.ge.com (Bruce Barnett) writes:
>   gary@sci34hub.sci.com (Gary Heston) writes:
>   Or you can get Ease 3.1 - which is a higher level language for
>   sendmail files. Ease does not replace sendmail. 
>Sendmail is ++ungood.
>
>My experience has been that Ease is not much better than sendmail,
>especially considering that the alternatives are so much better.

In what way is Ease 'not much better then sendmail'?

#include <standard_disclaimer>
'"Arf", she said.'
	- Mr. Frank Zappa
.-----------------------------------------------------------------------------.
| Kevin Johnson                     kjj@phx.mcd.mot.com | ...!mcdphx!QIS1!kjj |
| QIS System Administrator  Motorola MCG                                      |

spel@hippo.ru.ac.za (Dr. E.W. Lisse) (04/06/91)

In <1991Apr2.180215.1356@sci34hub.sci.com> gary@sci34hub.sci.com (Gary Heston) writes:

>In article <1991Apr1.173622.12281@appmag.com> pa@appmag.com (Pierre Asselin) writes:
>>The title pretty much says it.  I'm a new Unix sysadmin  and  I'm
>>going  to have to hack sendmail.cf real soon now.  I can read man
>>pages, but in this case I need a book to  get  started.

>Forget it. Unless you grew up with sendmail, you'll probably never
>figure it out. 

>Get smail3 off uunet, and convert to that. Understandable, works well,
>and has readable config files.

>-- 
>Gary Heston   System Mismanager and technoflunky   uunet!sci34hub!gary or
>My opinions, not theirs.    SCI Systems, Inc.       gary@sci34hub.sci.com
>I support drug testing. I believe every public official should be given a
>shot of sodium pentathol and ask "Which laws have you broken this week?".

There was something on alt.sources some weeks ago which takes
sendmail.cf and generates a readable file which in turn can be
recompiled into sendmail.cf.

It had something to do with 'easy' in the subject: line.

regards, el
--
Dr. Eberhard W. Lisse       (spel@hippo.ru.ac.ZA)
Katatura State Hospital     (formerly extel@quagga.ru.ac.za)
Private Bag 13215           (Real Soon Now ...  el@lisse.NA)
Windhoek, Namibia           (no FTP yet. [This is Africa :-)-O])

stealth@caen.engin.umich.edu (Mike Pelletier) (04/07/91)

In article <BARNETT.91Apr3153827@grymoire.crd.ge.com> barnett@crdgw1.ge.com writes:
>In article <1991Apr2.180215.1356@sci34hub.sci.com> gary@sci34hub.sci.com (Gary Heston) writes:
>>   Forget it. Unless you grew up with sendmail, you'll probably never
>>   figure it out. 
>
>>   Get smail3 off uunet, and convert to that. Understandable, works well,
>>   and has readable config files.
>
>Or you can get Ease 3.1 - which is a higher level language for
>sendmail files. Ease does not replace sendmail. You convert
>sendmail.cf files into Ease, edit them (with real variable names,
>keywords, preprocessor support, etc.) Then convert them back into
>sendmail.
>
>Instead of 
>---
>R$*<@$*$=m>$*		$1<@$2LOCAL>$4			convert local domain
>R$-!$+			$@$>6$2<@$1.uucp>		uucphost!user
>---
>You see
>---
>	if ( zero_or_more <@ zero_or_more  any_in_mydomainname > zero_or_more )	/* convert local domain */
>		retry ($1<@$2"LOCAL">$4);
>	if ( exactly_one ! one_or_more )	/* uucphost!user */
>		return (RULESET_6 ($2<@$1."uucp">));
>---
>So you see, you can't knock sendmail anymore because of the syntax,
>you have to pick a better reason. :-)

This just points out that sendmail files are easy to read once you pick
up the vocabulary:

 	R   <=> if( ... )
	$*  <=> zero or more
	$=x <=> any in <class x>
	$-  <=> exactly_one
	$+  <=> one_or_more
	$@  <=> return( ... )
	$>x <=> "to ruleset x" in return

This "ease" thing is just a more verbose way of writing sendmail.cf files,
with perhaps a more amenable learning curve.  You're saying precisely the
same things in an english derivative, but I think that the main problem that
people have with sendmail.cf files is not how you say it, but rather what
you say.  And the "ease" system doesn't address that at all.  It just makes
sendmail configuration less like writing line noise.

--
Mike Pelletier                     |
The University of Michigan's       |           [this section intentionally]
Computer Aided Engineering Network |           [         left blank       ]
  Usenet, UUCP, IRC and mail admin |

shore@theory.tn.cornell.edu (Melinda Shore) (04/08/91)

In article <14800@mcdphx.phx.mcd.mot.com> kjj@varese.UUCP (Kevin Johnson) writes:
>In what way is Ease 'not much better then sendmail'?

In that the difficulty in configuring sendmail is *not* the syntax,
but understanding how to rewrite an address and how to configure a
mailer.  Ease only addresses the syntax issue, and there are those
of who don't consider verbosity a positive feature.
-- 
                    Software longa, hardware brevis
Melinda Shore - Cornell Information Technologies - shore@theory.tn.cornell.edu

barnett@grymoire.crd.ge.com (Bruce Barnett) (04/08/91)

In article <14800@mcdphx.phx.mcd.mot.com> kjj@varese.UUCP (Kevin Johnson) writes:
   In what way is Ease 'not much better then sendmail'?

I may have comfused some people. 

If you think of sendmail.cf as  "machine language", then you can think
of Ease as an Assembly Language. You have more flexibility in
selecting variable and procedure names and have the ability to do conditional
"compiling", include files, etc.

I added several new enhancements to Ease that allow you to convert
almost any sendmail file into Ease, edit the file, and convert it back
into sendmail. The translation between Ease and raw cf files is
almost 1 to 1.

It is true that the standard sendmail distribution uses m4 as a
pre-processor. If you use m4, and remember all of the "$<whatever> " syntax,
Ease may not offer you much. It cannot provide more features than
sendmail, because it is merely a different language for the same
program.

It will generate a few warnings about unused classes, and Macros or
Classes used but not defined. Maybe some day I or someone else can add
more error checking.

I threw in a few extra "goodies" with the Ease distribution. I have a
shell script that grinds out the results from a list of addresses, so
I can test a sendmail.cf file before I install it. This does take a
long time to crunch thru each address, as I start up sendmail with the
debug option once for each address. A much more efficient method is to
use perl, start up sendmail once, and sent it each address one at a
time.

The real advantage of Ease is to those people who have to work with a
sendmail file, and the syntax of the sendmail.cf file makes their
knees shake. Ease just makes the learning curve easier.

--
Bruce G. Barnett	barnett@crdgw1.ge.com	uunet!crdgw1!barnett

chip@tct.com (Chip Salzenberg) (04/08/91)

According to jik@athena.mit.edu (Jonathan I. Kamens):
> Wasn't the FSF working on a mailer at one point?  Whatever happened with
>that?  Anybody know?

Smail 3.1 is _a_ GNU mailer, if not _the_ GNU mailer.

Smail 3.2 is in the works (slowly).  It is primarily a rework of the
existing functionality, with changes to deal better with high-volume
variable-reliability SMTP traffic.

Unfortunately, the persons assigned to work on it have been very busy.
The situation has improved recently; but I suspect that Smail 3.1 will
be state-of-the-art for some time.
-- 
Brand X Industries Custodial, Refurbishing and Containment Service:
         When You Never, Ever Want To See It Again [tm]
     Chip Salzenberg   <chip@tct.com>, <uunet!pdn!tct!chip>

chip@tct.com (Chip Salzenberg) (04/09/91)

According to barnett@crdgw1.ge.com:
>Example: There is one machine who is in domain "XYZ", who insists on
>re-writing their address into the form
>
>	user@XYZ.com.user@anything.arpa
>
>I can take that address and write it into the correct *.XYZ.ge.com
>address.

I am slack-jawed with amazement that any postmaster would jump through
hoops to fix an address so badly broken, instead of telling the people
in charge of domain XYZ to get a life.  Er, a mailer.

>Can smail3 or Zmailer do these things?

No, Smail 3.1 can't.  As for Smail 3.2, it might have a rewriting
facility.  But if it does, you can bet that it won't be as hard to
read as the Sendmail "standard".

>Any delivery agent that can solve those sorts of problems will be
>complex. It's not the fault of the MDA, it's because the problem is complex.

True enough.  IMHO, Sendmail actually makes things worse, though.
-- 
Brand X Industries Custodial, Refurbishing and Containment Service:
         When You Never, Ever Want To See It Again [tm]
     Chip Salzenberg   <chip@tct.com>, <uunet!pdn!tct!chip>

barnett@grymoire.crd.ge.com (Bruce Barnett) (04/10/91)

In article <2801C2BB.29BD@tct.com> chip@tct.com (Chip Salzenberg) writes:
>>	user@XYZ.com.user@anything.arpa
>>
>I am slack-jawed with amazement that any postmaster would jump through
>hoops to fix an address so badly broken, instead of telling the people
>in charge of domain XYZ to get a life.  Er, a mailer.

First of all, we all work for the same company. 

Second, we deal with a half-dozen different transport mechanism, and
every possible mail system a vendor has ever "blessed" by shipping. :-(
I do not want to become an expert in every possible variation of the
sendmail.cf file that has ever been shipped. Nor do I want to maintain
a single sendmail.cf file for every possible variation of Unix that
might be out there.

Third, the expertise required to send up a properly configured mail
system is not something you can learn by reading the vendor's manuals.

Fourth, some sites don't even have "system managers".  I consider
myself lucky if I find someone willing to fix the problems that exist.

I can either spend hours, days, or weeks on the phone, teaching the person on
the other end how to set up their system. This is not in my job
description to be a consultant for everyone who has root priviledge on
a workstation in GE.

Or I can add one line to the sendmail.cf file.

I typically try to push as much responsibility on the individual with
the problem. But I can't always get them to fix the problem.

>No, Smail 3.1 can't.  As for Smail 3.2, it might have a rewriting
>facility.  But if it does, you can bet that it won't be as hard to
>read as the Sendmail "standard".

Hey I'm biased. The "standard" is no longer sendmail.cf - it is Ease 3.

If you want to criticize the Ease syntax - fine with me. I didn't
design it. All I did was fix the remaining problems in Ease 2.

It is true the default code generated by the cf-to-ease translator
isn't the best in the world. Someone could write a new general purpose
configuration file that is more readable. I admit that

	if ( host . domain ! user ) 

is more readable than the default

	if ( one_or_more . one_or_more ! one_or_more )


But I don't have the time to write the Ultimate Sendmail file in Ease.
I'll leave that to someone else.
--
Bruce G. Barnett	barnett@crdgw1.ge.com	uunet!crdgw1!barnett

peter@ficc.ferranti.com (Peter da Silva) (04/11/91)

In article <14800@mcdphx.phx.mcd.mot.com> kjj@varese.UUCP (Kevin Johnson) writes:
> In what way is Ease 'not much better then sendmail'?

The syntax is better.

The semantics are the same old ad-hoc rewriting rules, still configured for
some random vendor's environment.
-- 
Peter da Silva.  `-_-'  peter@ferranti.com
+1 713 274 5180.  'U`  "Have you hugged your wolf today?"

rsalz@bbn.com (Rich Salz) (04/12/91)

In article <1991Apr3.202552.20907@athena.mit.edu> jik@athena.mit.edu (Jonathan I. Kamens) writes:
>   Wasn't the FSF working on a mailer at one point?  Whatever happened with
> that?  Anybody know?
In <5PHAVD9@xds13.ferranti.com> peter@ficc.ferranti.com (Peter da Silva) writes:
>Well, smail 3.1 is under the GPL, so that's probably what happened to it.
The last time FSF said something publically about mailers, they were still unsure
if they wanted to use smail3.1, Rayan's Zmailer, or roll their own.  I believe
that this is still the case.

I also remember that Rayan was lobbying Keith Bostic very hard to get Zmailer
accepted as a replacement for sendmail in 4.4.  Keith seemed interested, but
then it was late at night at a Usenix near the lobby bar... :-)

>The confusing thing is that smail 2.5 and smail 3.1 are completely different
>programs with not an atom of code in common. :-<
Yes.  smail3.1 is a very badly named program.
	/r$
-- 
Please send comp.sources.unix-related mail to rsalz@uunet.uu.net.
Use a domain-based address or give alternate paths, or you may lose out.

ylee@csl.dl.nec.com (Ying-Da Lee) (04/12/91)

In a field that has given the world all sorts of oddball tools
and designs, it always amazes me how sendmail(.cf) has come to
being shrouded in this mystique of unique incomprehension.  In
the tutorial on sys.admin. at the Dallas Usenix earlier this
year, people were warned not to roll their own sendmail.cf.  Even
more saddly, though it was noted that an unconditional invocation
of ruleset 3 at the beginning of rulest 0 as done in the sample
sendmail.cf was probably unnecessary (it was), there wasn't even
a suggestion that maybe it should be gotten rid of.  If your
sendmail accepts d option, try doing

/usr/lib/sendmail -bt -d21.30
0 a@b.c.edu 	(or pick any of your favorite mail addresses)

and watch pages of output flying by, then you may begin to
suspect that perhaps there are quite a lot of obsolete garbage
buried in your sendmail.cf.

I got sick of all the messy sendmail.cf's soon after I had to
deal with them.  So, after careful readings of a good sample
from Mr. Keith Moore of U. of Tennessee (thanks, Keith!), I
sat down with 'Customizing sendmail Configuration Files' from
Sun's manual and started to throw out Sun's rulesets and put in
my own.  We now have my version running on SunOS, BSD, Ultrix,
and even Microsoft's 386 Unix, and I know what each and every
rule in every single ruleset is doing!

Do I know all about sendmail?  Hardly.  I never read a single
line of code in the sendmail program.  But that's just the
point!  Read the available documentation carefully, get a good
sample sendmail.cf to give you some idea how it's done, and
spend a little time experimenting with it (you don't have to
dismantle the exiting mail system to do that), and I am sure
many people will find the mystique of sendmail.cf is just
that, mystique.

In article <dnsurber.670858623@node_2204c> dsurber@nasamail.nasa.gov writes:

... most convincingly of the need to document sendmail.cf.  This is
one of my primary concerns since I would hope sys.admins using my
stuff can understand enough to take care of their own needs.  Would
the two excerpts (macro definitions and ruleset 3) shown below be
considered sufficiently documented?

Comments are welcome, and I'll be happy to discuss my own experience.


	Ying-Da Lee
	ylee@csl.dl.nec.com
	uunet!necbsd!ylee

===================================================
# ==============================================================
# Macros used: (defined using D)
#	Z	Version  of this sendmail.cf
#	B	Mail gateway for BITNET
#	U	Mail gateway for UUCP
#	D	Local domain
#	F	Defined if and only if file /etc/LDHOSTS exists
#		and contains names of all hosts in local domain.
#	G	Next level mail gateway.  See explanantion below.
#		If G is undefined, then this machine is a direct
#		mail contact point with the entire Internet.
#	P	If not using DNS, should be undefined.  If using
#		DNS, pick whichever works with your mailer. (In
#		other words, try and see.)
#	I	My UUCP name.  Defined only if we have UUCP connections.
#
# ==============================================================
# Classes used: (defined using C or F)
#	A (C)	For "steam-powered" test
#	I (C)	All acceptable names for this host
#	S (C)	Pseudo domains
#	U (C)	My UUCP neighbors
#	F (F)	list of hosts in local domain
#		(File name /etc/LDHOSTS)
#	
# ==============================================================
# Examine the line or lines immediately preceding a line of
#^^^^^^^^^^^^^^^
# and modify it/them to suit the individual site.
#
# ==============================================================	
#
# Things to beware of:
# -	Some mailers doesn't recognize ruleset that is numbered > 29.
# -	Some mailers requires that the very last ruleset is ruleset 0.
# -	Some mailers demands that each string in a class be a single
#	token, e.g., abc.def will be rejected.  These are refered to
#	as steam-powered sendmail herein.
#
#===============================================================
#
# For ver. 1.5:
#
# -	Added simple detection of "steam-powered" sendmail. (Class
#	A and ruleset 28)
# -	Append unqualified names in To: and Cc: fields with
#	@localdomain as defined by macro D.
# -	Change the definition and use of macro j.
# -	Turn off automatic rebuild of alias file.
#
#===============================================================

# Version number of configuration file -- Change this after each mod
DZYDL1.5-910409.10
#^^^^^^^^^^^^^^^
# number before - is base version, number after is yymmdd.hh of last
# modification.

# All admissible names for this machine, including IP address(es) in []
# Also include the local domain name if we are its mail gatway.
CIflorida
CIflorida.csl.dl.nec.com
CI[143.101.64.3]
#^^^^^^^^^^^^^^^
# NOTE: Some steam-powered mailers, e.g., the Ultrix mailer,
# demands that each string in a class be a single token, thus
# rejecting things like host.domain.  For these pesky ones, we
# just have to spell out the nicknames one per rule in
# ruleset 0 near the beginning where we are stripping off
# our own name.

CAsteam.powered
# To see if your sendmail is of the steam-powered variety (see
# note above), get into address testing mode (option -bt) of sendmail
# using (option -C) this sendmail.cf, and try
# 28 steam.powered
# If the final answer is yes, you have a steam-powered sendmail
# and the beginning section of ruleset 0 has to be expanded.
# (See S0 below.)
#^^^^^^^^^^^^^^^

# Local domain
# Mail for machines within local domain is always sent directly.
# The sender field will conntain both the host name and the domain name.
# The mailer used for such mail is 'lybin'.
DDcsl.dl.nec.com
#^^^^^^^^^^^^^^^

# My UUCP name.  Defined only if we have UUCP connections.
# Must be undefined otherwise.
#DItexas
#^^^^^^^^^^^^^^^


# File containing unqualified hostnames in local domain.
# If undefined, all unqualified hostnames will be assume to be
# in local domain.
# Comment out next two lines if no such file exists.
#DF
#FF/etc/LDHOSTS
#^^^^^^^^^^^^^^^

# Next level mail gateway.
# The Mailer used for such mail is 'guabin'.
# For mail clients in a division, define this as the divisional mail gateway.
# For divisional mail gateway that can direct SMTP to all Internet
# sites, make this undefined.
# For divisional mail gateway that cannot SMTP to all Internet sites,
# define this as the locational mail gateway.
# For locational mail gateway, which must be able to SMTP to all Internet
# sites, make this undefined.
DGtexas.csl.dl.nec.com
#^^^^^^^^^^^^^^^

# pseudo domains
CSUUCP BITNET

# UUCP gateway on Internet
DUUUNET.UU.NET
#^^^^^^^^^^^^^^^

# Our UUCP neighbors
# Defined if and only if I is defined.
#CUuufake
#^^^^^^^^^^^^^^^

# BITNET gateway on Internet
DBCUNYVM.CUNY.EDU
#^^^^^^^^^^^^^^^
# Other candidates are:
#DBCORNELLC.CIT.CORNELL.EDU
#DBMITVMA.MIT.EDU
#DBPSUVM.PSU.EDU

# P should be undefined if not using Domain Name Service.
# If using DNS, you may or may not have to use this definition
# depneding on the mailer you use.
DP.
#^^^^^^^^^^^^^^^

# my official hostname
# Should be fully qualified, including local domain.
Dj$w
# For system that does not include domain part in macro w,
# use the following instead.
#Dj$w.$D
#^^^^^^^^^^^^^^
===============================================

S3

# find the next host and enclose it in <>
# output will be in the form of
#	<@host>something	 	( from @host:... or @host,...:...
#	something<@host>anything	( from ...@host or ...%host
#	anything<@host.UUCP>something	( from host!... or ...@host.uucp...
#	something 			(this is for local derlivery)
#	@				(this is error condition)

# handle "from:<>" special case
R<>			$@@

# basic textual canonicalization

# if already containg <>, discard all except part inside the innermost <>
R$*<$+>$*		$2

# block in everything
R$*			$:<$1>

# Look for leftmost @host in source route <@host,...,@host:user@host>
# This also happens to work if : is used in place of , in the format.
# We are assuming that there is no complication in the host part.
R<@$+,$+:$+>		$@<@$1>$2:$3
R<@$+:$+>		$@<@$1>$2

# Look for rightmost @host  within focused portion
R$*<$+@$+>$*		$1$2@<$3>$4
# above rule allows user@host@host...@host. Is this absolutely necessary?

# Look for leftmost host! within focused portion
R$*<$+!$+>$*		$:$1<$2>!$3$4

# now look for rightmost %host within focused portion
R$*<$+%$+>$*	$1$2%<$3>$4		focus on rightmost %host

# now tuck in the operative % or ! or @
# NOTE: the order of the next 3 rules is significant!
R$+%<$+>$*		$@$1<@$2>$3
R$*<$+>!$+		$@$1<@$2.UUCP>$3
R$+@<$+>$*		$@$1<@$2>$3

R$*<$*>$*		$@$1$2$3	local delivery or error

ylee@csl.dl.nec.com (Ying-Da Lee) (04/12/91)

In article <1991Apr7.164824.2586@engin.umich.edu> stealth@caen.engin.umich.edu (Mike Pelletier) writes:
>This "ease" thing is just a more verbose way of writing sendmail.cf files,
>with perhaps a more amenable learning curve.  You're saying precisely the
>same things in an english derivative, but I think that the main problem that
>people have with sendmail.cf files is not how you say it, but rather what
>you say.  And the "ease" system doesn't address that at all.  It just makes
>sendmail configuration less like writing line noise.

Well put.  My sentiment exactly.  Also, if you get to the
point of debugging or testing (-bt with sendmail), you HAVE TO deal with
sendmail.cf syntax anyway.

	Ying-Da Lee