From: rsalz@osf.org (Rich Salz)
Subject: Re: OR (remote mode)?
Organization: Open Software Foundation
Date: Wed, 29 Jul 1992 14:25:37 GMT

>I definitely recommend using one of the minimalist sendmail.cf's for this
>purpose that has been floating around the net instead of the OR option ...
> ... essentially the version that Rich Salz sent out
>on comp.mail.sendmail a while back (the smallest one I've seen so far:-),
>and all of the problems went away.
Since a few people have asked...

###
###  This is a SendMail configuration file for a client who can make a TCP
###  connection to a mail relay.  No local mail happens here.  SendMail is
###  not run in daemon mode, either, just hourly out of cron to pick up
###  anything left when the server was not reachable.
###

##
##  HOSTNAME MACROS AND CLASSES

##  The name of our corporate domain.
DCbbn.com

##  The official name of this host (from gethostname(2)).
Dj$w

##  The relay host where everything gets forwarded to.
DRpineapple.bbn.com

##
##  GENERAL CONFIGURATION INFORMATION
##  Stuff here is required and reflects some policy decisions.

##  SMTP login message.
De$j Sendmail $v/$V ready at $b; how did you get here?
##  Format of the UNIX from line -- essentially a constant.
DlFrom $g $d
##  Name to use for returned mail -- essentially a constant.
DnMAILER-DAEMON
##  Token delimeters -- word separators in the rewrite rules below.
Do.:%@![]
##  Format of a sender's address; use full name.
Dq$x <$g>
##  Version of this .cf file.
DVrsalz-13-nov-89

##  Location of the alias file.
OA/usr/lib/aliases
##  Default delivery mode (one of background, foreground, queue).
Odbackground
##  Permissions for any temporary files we create.
OF0644
##  Default group id for mailers to run under.
Og1
##  Location of the SMTP help file.
OH/dev/null
##  Logging level.
OL9
##  Send to sender if an alias expansion includes her (a/k/a "me too")?
OmT
##  Allow headers to be in old style (i.e., spaces delimit names)?
OoT
##  Where to send important error messages.
OPpostmaster
##  Location of the queue directory.
OQ/usr/spool/mqueue
##  Give up on connections after this long a time period.
Or2h
##  Queue up everything before starting transmission?
OsT
##  How long message can sit in queue before it's bounced back?
OT3d
##  Default user id for mailers to run under.
Ou1
##  Password to enter wizard/debug mode.
OW*

##  Message precedences.
Pfirst-class=0
Pspecial-delivery=100
Pbulk=-50
Pjunk=-100

##  Trusted users -- these people can fake headers.
Troot

##  Format of headers.
HReceived: $?sfrom $s $.by $j id <$i@$j>; $b
HDate: $a
HFrom: $q
HMessage-Id: <$t.$i@$j>
HResent-Date: $a
HResent-From: $q
HResent-Message-Id: <$t.$i@$j>

##
##  REWRITING RULES
##
##  These are the rules used for the following fields:
##	 From	3 -> 1 -> 4 -> 3 -> 1 -> S -> 4
##	 To	3 -> 0 -> 4
##	 From:	3 -> 1 -> 5 -> 4
##	 To:	3 -> 2 -> R -> 4
##  where S and R stand for the mailer-specific rewrite rules named in
##  the mailer definition.


##
##  RULESET  0 -- Pick a mailer.
S0
R$*<$*>$*		$1$2$3			defocus
R$+			$:$>3$1			make canonical
R$*<@[$+]>$*		$#TCPrelay$@[$2]$:$1@[$2]$3	numeric internet spec
R$*<$*.>$*		$1<$2>$3		drop trailing dot
R<@>:$*			$@$>0$1			retry after route strip
R$*<@>			$@$>0$1			strip null trash & retry
## Machine dependent part of ruleset 0.
## Here is where we actually find a mailer to invoke.
R$*			$#TCPrelay$@$R$:$1	forward everything


##
##  RULESET  1 -- From and From: fields.
S1


##
##  RULESET  2 -- To: field.
S2


##
##  RULESET  3 -- Basic name canonicalization.
S3
# Handle the SMTP "from:<>" as a special case.
R<>			$@@			turn into magic token
# Basic textual canonicalization.
R$*<$+>$*		$2			basic RFC821/822 parsing
R$*<$*>$*		$1$2$3			in case recursive
R$+:$*;@$+		$@$1:$2;@$3		list syntax
R@$+,$+			$2			Ignore source routes, as
R@$+:$+			$2			RFC-1123 suggests
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$+%$+			$@$>6$1<@$2>		u%h
R$-!$+			$@$>6$2<@$1.UUCP>	resolve uucp names


##
##  RULESET  4 -- Final output rewriting.
S4
R@			$@			handle <> error addr
# Externalize local domain info.
R$*<$*LOCAL>$*		$1<$2$R>$3		change local info
R$*<$+>$*		$1$2$3			defocus
R$+<@$w>		$1			remove our name
R$+@$-.UUCP		$2!$1			u@h.UUCP->h!u


##
##  RULESET  5 -- From: field post-processing (just before final).
S5


##
##  RULESET  6 -- Canonicalize hostname (called from ruleset 3).
S6
R$+<@$+.$+.UUCP>	$1<@$2.$3>		u@h.d.uucp->u@h.d


##
##  RULESET 14 -- All fields for all mailers
S14


##
##  MAILER SPECIFICATIONS
##

##  local; an error as we do no mail delivery here
Mlocal, P=/usr/lib/sendmail, F=DFILMmsuX, S=14, R=14, A=sendmail $n

##  prog; an error as we do no mail delivery here
Mprog,  P=/usr/lib/sendmail, F=DFILMmsuX, S=14, R=14, A=sendmail $n

##  TCPrelay; connect to Sendmail on relay host.
MTCPrelay, P=[IPC], F=DFLMmsuX, S=14, R=14, A=IPC $h, E=\r\n
Newsgroups: comp.mail.sendmail