From: larsen@OES.ORST.EDU (Scott Larsen)
Newsgroups: comp.sys.hp
Subject: Re: Sendmail/DNS mail routing (Anwser)
Summary: Lobotomize clients, MX, mail hub.
Keywords: MX, sendmail, mail
Date: 9 Oct 92 15:22:48 GMT
Article-I.D.: news.Bvv1EC.C0G
Organization: Oregon Extension Service, Oregon State University, Corvallis, Or.

In article <1992Oct9.134914.2990@vssi.trw.com> b_kondalski@vssi.trw.com (Brian J. Kondalski) writes:
>    I was wondering if anyone out there could give me some help with configuring
>the sendmail file to work with DNS.  What I would like to do is set things up
>so that any mail sent to my domain would go to the mail server.  Also I want
>any mail sent to any other node to go to the mail server (ie, hide my nodes).
>I've looked through the "Installing and Administering ARPA Services" and found
>references to this, and even configured what they suggested with no luck.


Ahh, yes.  The old mail hub problem with HP/UX.

Here's one way of doing it:

1) configure all client workstation sendmails to be mail-stupid.  ie. pass
	all mail off to mail hub for resolution.  SEE ATTACHED SENDMAIL.CF
	FOR DETAILS!  Redefine macro "R" for your site!

2) configure all client workstations to have the same /usr/mail directory.
	ie. mount mail server's /usr/mail

3) configure mail server to use DNS.  ie. define option "I" in sendmail.cf.
	(soapbox: you should be using DNS anyway!)

4) configure mail server sendmail to accept mail for all client workstations.
	ie. define class "w" in server sendmail.cf.  I recommend using a file
	class, and generating this file and refreezing sendmail automatically.
	(ex. "Fw/usr/lib/sendmail.hosts.hide %s")

5) configure mail server sendmail to accept mail and for and rewrite internal
	addresses as your greater domain. (accept and rewrite mail as 
	user@foobar.com instead of user@my.host.foobar.com).  ie. define 
	class "Y" in mail hub sendmail.cf


This should do it.

Contact me if you have further questions or problems.



Scott Larsen
larsen@oes.orst.edu                      UUCP: hplabs!hp-pcd!orstcs!larsen
--------------------------------------------------------------------------
"We know what happens to people who stay in the middle of the road.
 They get run over."
		- Aneurin Bevan

Dumb mail client sendmail.cf begins here:


############################################################
############################################################
#####                                                  #####
#####           SENDMAIL CONFIGURATION FILE            #####
#####                                                  #####
############################################################
############################################################


############################################################
#####                                                  #####
#####               Configuration Version              #####
#####                                                  #####
#####               @(#)$Revision: 2.0 $               #####
#####                                                  #####
##### Please change BOTH version numbers when a change #####
##### is made.  One is used by RCS, the other by       #####
##### Sendmail.                                        #####
#####                                                  #####
############################################################

DV2.0 Lobotomized Client

############################################################
############################################################
#####                                                  #####
##### Revision History at Cascade Corporation          #####
#####                                                  #####
##### 1.0 -- 92/02/01 -- Scott Larsen                  #####
#####     Set up for message headers,                  #####
#####     Postmaster mail.                             #####
#####                                                  #####
##### 2.0 -- 92/03/18 -- Scott Larsen                  #####
#####     Completely lobotomized the client sendmail   #####
#####     so that they just push mail off to the mail  #####
#####     server, defined by macro "R"                 #####
#####                                                  #####
############################################################
############################################################

#
#	Special macros
#
# SMTP login message (should never get to this, but just in case...)
De$j HP Sendmail ($v/$V) ready at $b

# official hostname
Dj$w

# my name
DnMAILER-DAEMON

# Custom macros to ensure "From: user@host.domain" format
Dg$f@$j
Dq$?x$x $.<$g>
HFrom: $q

#
#	Options
#
# no alias file
OA

# deliver in background
Odbackground

# temporary file mode
OF0600

# default UID
Ou1

# default GID
Og1

# location of help file (should never get used)
OH/usr/lib/sendmail.hf

# log level (verbose but common)
OL10

# Assume headers may have space seperated names
Oo

# CC to postmaster for errors (will actually get sent to mail router)
OPPostmaster

# queue directory
OQ/usr/spool/mqueue

# read timeout -- violates protocols
Or2h

# no statistics file
OS

# queue up everything before starting transmission
Os

# default timeout interval
OT3d

#
#	Local definition!!!
#	Mail routing host
#
DRmazama

#
#	Rewriting rules
#
# This rule just forwards everything to host $R
S0
R$*		$#ether$@$R$:$1

S1
R<$*>		$1

S2
R<$*>		$1


# Name Canonicalization

# Internal format of names within the rewriting rules is:
# 	anything<@host.domain.domain...>anything
# We try to get every kind of name into this format, except for local
# names, which have no host part.  The reason for the "<>" stuff is
# that the relevant host name could be on the front of the name (for
# source routing), or on the back (normal form).  We enclose the one that
# we want to route on in the <>'s to make it easy to find.
# 
S3

R<$*>		$1

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

# basic textual canonicalization
R$*<$+>$*		$2				basic RFC822 parsing

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

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 names to domain-based names
# All old-style names parse from left to right, without precedence.
R$-!$+			$@$>6$2<@$1.uucp>		uucphost!user
R$-.$+!$+		$@$>6$3<@$1.$2>			host.domain!user
R$+%$+			$@$>3$1@$2			user%host

#
#	Mailer specifications
#
# All mailers talk SMTP
Mlocal, P=[IPC], F=hmnsuX, A=IPC $h
Mprog,	P=[IPC], F=hmnsuX, A=IPC $h
Mether,	P=[IPC], F=hmnsuX, A=IPC $h
Newsgroups: comp.sys.hp