XThe example above defines the ruleset \*QEXAMPLE_RW\*U, which contains four
Xrewriting rules. The first rewriting rule discards all tokens of an address
Xwhich lie on either side of a pair of angle brackets (<>), thereby
Xrewriting the address as
Xthe sequence of tokens contained within the angle brackets ($2). Following the
Xaddress rewrite, the rule is applied again (\fIretry\fR). When the first rule
Xfails to match the address being rewritten, the second rule is applied.
X.PP
XThe second
Xrule simply replaces the word \*Qat\*U by the symbol \*Q@\*U. The \*Q\fInext\fR\*U
Xaction specifies that if a match is made, a rewrite is performed and
Xmatching continues at the next (or following) rule.
X.PP
XThe third rule illustrates
Xthe use of the \*Q\fIreturn\fR\*U action, which is executed if the
Xpattern \*Q@path: usr\*U
Xdescribes the current format of the address being rewritten. In this example,
Xthe \fIreturn\fR action returns the result of a call to ruleset \*QLOCAL_RW\*U,
Xwhich rewrites the address \*Q<@$1>:$2\*U, where $1 and $2 are substituted
Xwith the token(s) matched respectively by \*Qpath\*U and \*Qusr\*U.
X.PP
XThe fourth (and final) rule signals a resolution (and termination) of the
Xrewriting process if the given pattern is matched. The resolution specifies
Xthat the mailer \*Qtcp\*U will be used to deliver the message to the host
X\*Qrelay.cs.net\*U.
XThe \fIuser\fR parameter specifies the final form of the address
Xwhich \fIsendmail\fR has just resolved.
X.sp 2
X.PP
XThe \fBEase\fR construct which remains to be examined is the
X\fBconditional-expression\fR. The \fBconditional-expression\fR provides a
Xmethod for
Xconstructing strings based on the condition that some test macro is (or is not)
Xset. The general form begins with the concatenation of a string and a
X\fBstring-conditional\fR:
X.DS
X \fIconcat\fR ( <quoted-string>, \fBstring-conditional\fR )
X \fIconcat\fR ( \fBstring-conditional\fR, <quoted-string> )
X.DE
XA \fBstring-conditional\fR assumes either of the following forms:
X.DS
X \fIifset\fR ( <macro-name>, <ifset-string> )
X \fIifset\fR ( <macro-name>, <ifset-string>, <notset-string> )
X.DE
XA \fBstring-conditional\fR of the first form evaluates to \*Qifset-string\*U
Xif the macro \*Qmacro-name\*U has been assigned a value; otherwise it
Xevaluates to the null string. The second form behaves similarly, except
Xthat the \fBstring-conditional\fR evaluates to \*Qnotset-string\*U, instead
Xof the null string, if the macro \*Qmacro-name\*U has no value.
X.sp 1
XThe following \fBconditional-expression\fR,
X.DS
X \fIconcat\fR ( "New ", \fIifset\fR ( city, "York", "Jersey" ) )
X.DE
Xevaluates to the string "New York", if the macro \*Qcity\*U is set. Otherwise,
Xthe \fBconditional-expression\fR evaluates to the string "New Jersey".
X.NH 2
XLatest Changes
XThe first two releases of \fBEase\fP provided a good starting point
Xfor managing \fIsendmail\fP files. However, the translation wasn't
Xperfect. Some editing needed to be done before \fBEase\fB could be
Xused.
XBruce G. Barnett made modifications to Arnold Robbin's \fBEase\fP to
Xsendmail convertor \fIcfc\fP and tested these changes to verify a
X\fIsendmail\fP configuration fle could be translated into \fBEase\fP
Xand back with no errors: at least for the more common versions of
X\fIsendmail\fP.
XIn case this translation is not perfect, \fBEase\fP version 3 supports
Xthe \fIasm("...")\fP command, which passes the contents of the string
Xdirectly to the \fIsendmail.cf\fP file.
XAlso - support for SunOS and Ultrix sendmail were added.
XNew options and flags were added, and well as the \fIypmap\fP (SunOS),
X\fIypalias\fP and \fIyppasswd\fP (Ultrix) functions.
X.NH
XEase Translation
X.PP
XIt is important to note that \fBEase\fR is translated by a stand-alone
Xtranslator to the raw configuration file format. No modifications were
Xmade to the \fIsendmail\fR program itself. As a result, syntactical verification
Xof a configuration file can be performed without invoking \fIsendmail\fR.
X.PP
XThe \fBEase\fR language is translated by invoking
Xthe \fBEase\fR translator (\fIet\fR). If the command line options include a flag understood by the C language preprocessor (cpp), \fIet\fP automatically
Xpipes input through \fIcpp\fP.
XThe \fBEase\fR
Xtranslator may be invoked on the command line in one of four ways:
X.TS
Xcenter box ;
Xl l .
X\fIet\fR <options> <input-file> <output-file> [read from a file, write to a file]
X\fIet\fR <options> <input-file> [read from a file, write to standard output]
X\fIet\fR <options> - <output-file> [read from standard input, write to a file]
X\fIet\fR <options> [read from standard input, write to standard output]
X.TE
X.NH
XConclusion
X.PP
X\fBEase\fR is [ed - this information is old] currently in use at the
XPurdue University Computing Center. Source code for the \fBEase\fR
Xtranslator (\fIet\fR) may be obtained on request by writing to:
X.DS
XU.S. Mail:
X James S. Schoner
X c/o Kevin S. Braunsdorf
X Purdue University Computing Center
X Purdue University
X West Lafayette, Indiana 47907
X
XElectronic Mail:
X ksb@j.cc.purdue.edu
X.DE
X.PP
XMuch of the success of this project is attributable to the constant support
Xand insight offered by Mark Shoemaker. To him, I owe a debt of gratitude. In
Xaddition, I would like to thank Kevin Smallwood, Paul Albitz, and Rich Kulawiec
Xfor their many notable suggestions and valuable insight.
X.NH
XAcknowledgements
X.PP
XArnold Robbins would like to acknowledge contributions from
XStephen Schaefer of Bowling Green State University,
XJeff Stearns of John Fluke Manufacturing Company,
XRaymond A. Schnitzler of Bellcore,
XAndrew Partan of the Corporation for Open Systems,
Xand
XBruce G. Barnett, of General Electric.
XThe good intentions of Rich Salz, of Bolt Beranak, and Newman,
Xare also acknowledged.
X.PP
XThe most up to date version of \fBEase\fR should be gotten from the