home *** CD-ROM | disk | FTP | other *** search
- Subject: v25i017: Ease 3.5 - high-level sendmail.cf language, Part01/06
- Newsgroups: comp.sources.unix
- Approved: vixie@pa.dec.com
-
- Submitted-by: Bruce G. Barnett <barnett@crdgw1.ge.com>
- Posting-number: Volume 25, Issue 17
- Archive-name: ease3.5/part01
-
- If you would like to write:
-
- if ( exactly_one ! one_or_more ) /* uucphost!user */
- return (RULESET_6 ($2<@$1."uucp">));
-
- ...instead of:
-
- R$-!$+ $@$>6$2<@$1.uucp> uucphost!user
-
- ...then you want this package. If you don't understand the above, you may
- want to unpack this and look at it, since it provides an excellent high-
- level way of looking at the otherwise inscrutable sendmail.cf philosophy.
-
- This is Ease 3.5, and it includes a "decompiler" that lets you start from
- your existing ("working") sendmail.cf. You can translate your existing
- sendmail.cf into "ease", edit it as "ease" code, and then translate it back.
- It's never been safer to try something new.
-
- --mod
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 1 (of 6)."
- # Contents: MANIFEST README TESTING TODO bin cfc cfc/Makefile debug
- # debug/Makefile debug/debug.in debug/showhow debug/showwhere doc
- # doc/Makefile doc/ap1 doc/ap2 doc/ap3 doc/ap4 doc/cover
- # doc/ease.man doc/et.man src src/fixstrings.c src/fixstrings.h
- # src/symtab.h test test/README test/args test/test.addresses
- # test/test.cf utils utils/Makefile utils/build-new-aliases
- # utils/cfdiff.sh utils/cfstrip.sh
- # Wrapped by vixie@cognition.pa.dec.com on Tue Dec 10 08:45:55 1991
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'MANIFEST' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'MANIFEST'\"
- else
- echo shar: Extracting \"'MANIFEST'\" \(1739 characters\)
- sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
- X File Name Archive # Description
- X-----------------------------------------------------------
- X CONVERTING 2
- X INTRO 3
- X MANIFEST 1
- X Makefile 2
- X README 1
- X TESTING 1
- X TODO 1
- X bin 1
- X cfc 1
- X cfc/Makefile 1
- X cfc/cfc.c 6
- X debug 1
- X debug/Makefile 1
- X debug/debug.in 1
- X debug/showhow 1
- X debug/showwhere 1
- X doc 1
- X doc/Makefile 1
- X doc/ap1 1
- X doc/ap2 1
- X doc/ap3 1
- X doc/ap4 1
- X doc/cfc.man 2
- X doc/cover 1
- X doc/ease.man 1
- X doc/ease.paper 5
- X doc/et.man 1
- X src 1
- X src/Makefile 2
- X src/ease.sh 2
- X src/emitcf.c 3
- X src/errors.c 2
- X src/fixstrings.c 1
- X src/fixstrings.h 1
- X src/idman.c 2
- X src/lexan.l 3
- X src/lexan.patch 2
- X src/main.c 3
- X src/parser.y 4
- X src/strops.c 3
- X src/symtab.c 2
- X src/symtab.h 1
- X test 1
- X test/README 1
- X test/args 1
- X test/test.addresses 1
- X test/test.cf 1
- X test/test.mc 2
- X utils 1
- X utils/Makefile 1
- X utils/build-new-aliases 1
- X utils/cfdiff.sh 1
- X utils/cfstrip.sh 1
- END_OF_FILE
- if test 1739 -ne `wc -c <'MANIFEST'`; then
- echo shar: \"'MANIFEST'\" unpacked with wrong size!
- fi
- # end of 'MANIFEST'
- fi
- if test -f 'README' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'README'\"
- else
- echo shar: Extracting \"'README'\" \(9927 characters\)
- sed "s/^X//" >'README' <<'END_OF_FILE'
- This is release 3.5 of the CFC and Ease programs.
- X
- XEase is a compiler for sendmail configuration files. It reads a high-level
- mail configuration language and produces a sendmail.cf file. If you've ever
- stared at a sendmail.cf, you know why this is valuable.
- X
- Cfc is performs the inverse operation: it converts sendmail.cf files
- into source for ease. Combined with ease it allows you to convert a
- sendmail.cf file into a more readable format, which you can edit and
- convert back into sendmail.cf for installation.
- X
- There is no longer a reason to complain about the syntax of sendmail.cf files.
- X
- This is a complete posting of the entire source for 'ease' and "cfc'.
- It incorporates all of the previous netwide posting (version 2.0),
- plus some additional support for new and undocumented sendmail features.
- It supports several vendor-specific versions of Sendmail.
- X
- X
- X
- XEase was originally written by James S. Schoner,
- X Purdue University Computing Center,
- X West Lafayette, Indiana 47907
- XEase 3.0 was developed by Bruce G. Barnett and has been enhanced and
- maintained by various persons, most notably
- X Arnold D. Robbins (arnold@unix.cc.emory.edu),
- X Stephen Schaefer of Bowling Green State University,
- X Raymond A. Schnitzler of Bellcore,
- X Andrew Partan of the Corporation for Open Systems,
- X Rich Salz of Bolt Beranak, and Newman.
- X bent@lccinc.UUCP (Ben Taylor)
- X "Jonathan I. Kamens" <jik@pit-manager.mit.edu>
- X Matt Heffron <heffron@falstaff.css.beckman.com>
- X William Roberts <liam@cs.qmw.ac.uk>
- X rainer@flyer.uni-duisburg.de (Rainer Bieniek)
- X agq@dstos3.dsto.oz.au (Ashleigh Quick)
- X
- Cfc was written by Arnold D. Robbins, and has been enhanced by Bruce Barnett
- X(see below).
- X
- Notable changes to cfc since release 2.0 are described in the note
- from Bruce Barnett below.
- X
- X
- X -----------------------------------------------------------
- X
- X Ease 3.5 Release Notes:
- X Bruce G. Barnett <barnett@crdgw1.ge.com>
- X November 1991
- X
- I sent some patches to the authors of Ease several years ago, but they never
- released them. I now have their permission to be the current maintainer of
- XEase and cfc. Most of the changes to Ease since 2.0 have been mine, with
- some generous patches sent in from the people described above.
- X
- The main enhancement I added to Ease 3.0:
- X
- X
- X I subjected the Cfc/Ease programs to a test suite
- X that converted *.cf files to ease files, and back again.
- X I compared the input of cfc (The original .cf file)
- X to the output of ease. The goal was twofold:
- X
- X 1. To automatically produce an Ease file than can
- X be used to generate a .cf file identical to the original
- X 2. To produce an Ease file that can be used without
- X editing. You will see warnings, and possible errors
- X that came from the vendor's supplied sendmail.cf
- X file. But in a few minutes time, you should have a
- X working, and error free, ease version of your
- X sendmail.cf file.
- X
- X In other words, you can start using ease as a high level
- langauge and feel confident that you won't break anything.
- X
- X
- Current status of Ease 3.5
- X It will handle 100% of the standard Ultrix, SunOS, HP, and Berkeley
- X versions of sendmail (I hope). It handles 99.5% of the IDA
- X enhancement package. It compiles of dozens of different machines.
- X See the TODO file for problems.
- X
- X I don't plan to do any major work maintaining this package,
- but I will gladly accept bug fixes and enhancements.
- X
- New features of the Ease grammar at a glance:
- X
- Added asm("") command. This can be used to insert something strange into
- X the sendmail file. Or something Ease or cfc is too stupid to
- X translate properly. This is the work-around for the new/fancy
- X stuff.
- X
- XExample:
- X asm("Dq$?x$!x <$g>$|$g$.");
- X
- Added eval() [$&]
- X
- SunOS 4.0 support:
- X Added m_domain
- X Added o_maxempty
- X Added o_maxhops
- X Added o_nfs
- X Added o_aliasfile
- X Added ypmap() [${ $} on RHS]
- X
- X Added default definitions of
- X any_in_etc_hosts
- X any_in_mydomainname
- X any_in_myhostname
- X
- Ultrix 3.0 support:
- X Added f_mail11
- X Added ypalias() [${ on LHS]
- X Added yppasswd() [$" on LHS]
- X
- HP/UX support:
- X added o_nameserver OI
- X added program() $<
- X
- IDA support:
- X Added f_relativize
- X Added m_uucpname
- X Added o_envelope
- X Added f_bsmtp
- X Support for Header/Envelope re-write rulesets (S=20/21)
- X alias() $(@ in RHS
- X quote() $! in headers
- X
- X resolved():
- X # if (resolved( one_or_more )) /* found one, return it */
- X # resolve (mailer ($1));
- X R$#$+ $#$1
- X
- X nested rulesets:
- X # if ( one_or_more @. one_or_more ? one_or_more ) /* relativize & return */
- X # resolve (mailer (TCP),
- X # host ($3 ),
- X # user (retry (RULESET_28($1@.$2))));
- X R$+@.$+?$+ $#TCP$@$3$:$>28 $1@.$2
- X user (retry (RULESET_28($1@.$2))));
- X
- X canon with default value:
- X # if ( one_or_more @ exactly_one ) /* host: try name server */
- X # return ( $1@ canon ( $2 default ( $2."UUCP ")));
- X R$+@$- $@$1@$[$2$:$2.UUCP $]
- X
- X
- X
- X----------------
- General Improvements to the Ease Program:
- X Improved reporting of syntax errors
- X Built in use of /lib/cpp
- X if et is given a CPP flag, it will call it.
- X If a macro is a single upper case letter, and has not been defined
- X the letter assigned to it will be the same as the macro name.
- X This allows the original input file to be compared to the ease
- X output.
- X
- X There have been some substantial changes to the grammar handling.
- X Several improvements have been made to the error reporting.
- X In addition, ease supports the -d flag, which is used to debug
- X the parser. (See the makefile if you are interested in this.)
- X
- X Several bugs were fixed, including a lot of problems with the ifset()
- X construct. It's still not perfect. See the manual page for cfc(local)
- X
- X----------------------------
- Changes to CFC (Sendmail.cf to ease translator):
- X
- X Added new flags to cfc:
- X -s => SunOS
- X -i => IDA sendmail
- X -d => Ultrix
- X -C [..] => add predefined classes
- X e.g. -C ADG => added classes A, B, and G
- X
- See the file CONVERTING on tips to convert your sendmail file into ease.
- I have included some scripts that can compare the original sendmail
- file to the output of ease. If the rules are identical, then you can
- feel comfortable using ease instead of raw cf.
- X
- X
- X--------------
- I have included the document TESTING, along with some
- shellscripts that I use to perform regression testing of sendmail.
- When I make a major change to my sendmail rules, I run a series of
- addresses through sendmail and look at the differences. This way I can
- check for address rewrite errors before I install a new version.
- X
- I have also include a document called INTRO, that gives a simple
- introduction to sendmail. You may want to look at the file
- X debug/Makefile
- as this gives you an example how I do it.
- X
- This package also includes two more goodies:
- X
- X build-new-aliases - this is a shell script I use to
- X kill sendmail, rebuild the aliases, and restart
- X sendmail. The problem is sometimes a kill -15 won't
- X immediately stop sendmail from running. This gives
- X the daemons a change to clean up first.
- X
- Also - see the directory test. This includes a shell script to test
- sendmail files, written by Simon Kenyon. You have two ways to debug
- sendmail files now!
- X
- X
- Release Notes:
- X
- X 3.5: Documentation and Copyright changes,
- X doc/makefile changed
- X 3.4:
- X generate error if the number of positional parameters on
- X the RHS don't match the LHS, i.e.
- X if ( <@ any_in_myhostname . "LOCAL">: one_or_more)
- X next ($3); /* should be $2 */
- X 3.3:
- X Support for $? $| $. on LHS
- X added warning if $. is missing
- X Support for $? after $#
- X Fix DATA_RW compile option
- X Eliminate warnings about "LOCAL" and "ERROR"
- X mailers being undefined. Case doesn't matter.
- X but I don't want to convert to lower because the cfdiff
- X might complain
- X 3.2:
- X Added better support for IDA sendmail
- X Added better support for unusual values in mailer flags, and options
- X Better BSD/SYSV Portability (See the Makefile)
- X Better support for those machines with read only text areas.
- X (See compile flag DATA_RW in makefile)
- X The cfstrip and cfdiff script was improved
- X The documentation was improved
- X
- Release 3.1:
- X Fixed bug with machines that didn't like free(0).
- X Other portability problems
- X Added support for MALLOC_DEBUG flag
- X
- Release 3.0:
- X First release of Bruce's changes to the net in alt.sources
- X
- X
- X
- NOTE:
- X
- on some systems (e.g. SunOS) , you will get the warning:
- X make: Warning: Infinite loop: Target `lexdefs.h' depends on itself
- This is okay. If the line was removed, Make wouldn't work on other machines.
- Better a warning than an error on other machines.
- X
- X============================================================================
- X
- If you find these programs useful, or if you have suggestions or changes,
- please drop me a line. I would really appreciate any patches to this
- package. I will merge any patches and release new versions, as they
- are sent to me.
- X
- X Bruce Barnett
- X General Electric
- X Corporate Research and Development
- X P. O. Box 8, 1 River Road
- X Schenectady, NY 12301
- X
- X barnett@crd.ge.com
- X
- X
- X
- XEase was originally written by
- X James S. Schoner, Purdue University Computing Center,
- X West Lafayette, Indiana 47907
- and is copyright (c) 1985 by Purdue Research Foundation.
- Redistribution and use in source and binary forms are permitted
- provided that: (1) source distributions retain this entire copyright
- notice and comment, and (2) distributions including binaries display
- the following acknowledgement: ``This product includes software
- developed by Purdue University, Indiana and its contributors''
- in the documentation or other materials provided with the distribution
- and in all advertising materials mentioning features or use of this
- software. Neither the name of the University nor the names of its
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- END_OF_FILE
- if test 9927 -ne `wc -c <'README'`; then
- echo shar: \"'README'\" unpacked with wrong size!
- fi
- # end of 'README'
- fi
- if test -f 'TESTING' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'TESTING'\"
- else
- echo shar: Extracting \"'TESTING'\" \(2305 characters\)
- sed "s/^X//" >'TESTING' <<'END_OF_FILE'
- X Testing Sendmail Configuration files
- X
- I have written some shell scripts called "showhow" and "showwhere"
- that can be used to test your sendmail configuration file.
- X
- You create an input file with a set of addresses to test. You run the
- script and it generates an output file, showing the results of each
- address. When I make a major change to a sendmail file, I run the test
- suite on it, comparing the results with the last time I tested the
- address. I can use this to see in any of the 400 addresses in my test
- suite will behave differently with the new configuration file. My
- addresses won't help you, so you have to be creative and add your own.
- Here are some guidelines.
- X
- The format or the input file debug.in is:
- X rulesets address
- X or
- X rulesets address comment
- X
- Use the second if ruleset does not start with a '0'. I'll explain this later.
- X
- X Example:
- X
- X 0 user@some.do.main
- X 0 site!user%site2@site3.com
- X 22,4 user@localsite Sender_via_UUCP
- X
- where 22 is a mailer rewrite ruleset for a mailer (i.e. UUCP).
- X
- Ruleset 0 must be avoided when testing the re-write rules for mailers
- because ruleset 0 outputs a triple (user, host, mailer), and only one
- part (user) passed to the mailers. Therefore you would typically have
- ruleset 0 when testing resolution decisions, and omit it when testing
- for mailer re-writes like UUCP and TCP final delivery.
- X
- Some newer versions of sendmail do not automatically run ruleset 3 when
- in debugging mode. You will have to add '3,' before each rule.
- X
- The makefile generates a file in tbl(1) format that
- lists the following:
- X
- X ruleset address mailer hostname user
- X
- Showing the resolved triplet for each address
- X
- I think the scripts I have will work on IDA, SunOS 4.0, and Ultrix 3.0
- sendmail executables. The problem is that older sendmails output debug
- info using ^V, etc. instead of $#. The script is set up to work with
- Ultrix 3.0. The sendmail with SunOS used a different set of
- characters to indicate the results of a rule (^W instead of ^V).
- X
- I have set up a makefile in the debug directory that you can use
- X
- X make - tests your sendmail file against a known good file
- X good.out. Once you have a working set of rules, copy
- X debug.out to good.out
- X
- X make report will print a table of all of the addresses resolved to the address, mailer, and hostname
- X
- END_OF_FILE
- if test 2305 -ne `wc -c <'TESTING'`; then
- echo shar: \"'TESTING'\" unpacked with wrong size!
- fi
- # end of 'TESTING'
- fi
- if test -f 'TODO' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'TODO'\"
- else
- echo shar: Extracting \"'TODO'\" \(1886 characters\)
- sed "s/^X//" >'TODO' <<'END_OF_FILE'
- Things to do for Ease 3.?
- X-------------------------
- X
- X
- XFix the following constructs so that cfc/et handles the conversion properly:
- X
- X # indirect macros, i.e.
- X DMroot
- X T$M
- X
- XEliminate the concat() construct, if possible.
- X
- check for if (exactly_one) next($2); type error.
- check for matching < and > in rulesets
- Check for mailers "local" and "prog"
- X
- Add the new IDA/sendmail macro $m
- X
- X A new macro, $m, has been defined. For single recipients in
- X a local mail delivery, it's value is the original address before
- X aliasing. If all recipients for the current transaction derive
- X from a single original recipient, use that for $m. Else make
- X $m undefined (to preserve Bcc: privacy).
- X
- X The Received header now has 'for $m' in place of 'for $u'. The
- X new code release supports $m as the recipient prior to aliasing.
- X This will not cause any problems with earlier code releases, except
- X that the 'for user' will no appear on the header unless you change
- X this back to $u.
- X
- X
- Add the IDA Os option:
- X
- X If Os (SuperSafe) is set in the sendmail.cf file, files in the spool
- X area will either be open()ed with O_SYNC set or fsync()ed prior
- X to close.
- X
- IDA:
- X Simon J Gerraty (sjg@melb.bull.oz.au) contributed patch for SUN's
- X $%x and $!x features ($!x added as $^x).
- X
- X * delayed macro evaluation using $&x syntax
- X * RFC822 quoted macro expansion using $!x syntax
- X
- X
- Silicon Graphics:
- X Add the $[! lookup operator for pathalias
- CFC improvements
- X Make it a real two-pass parser. This way, it can
- X properly specify the rulesets, macros, and classes it
- X needs. Or else write a shell script that determines which rulesets,
- X macros, and classes are needed.
- X
- XError Detections
- X Eliminate syntax errors that just report "syntax error"
- X
- Regression Testing script:
- X
- X rewrite it into perl for speed
- X
- X--
- Bruce G. Barnett <barnett@crdgw1.ge.com> a.k.a.
- X<barnett@[192.35.44.4]> uunet!crdgw1!barnett
- END_OF_FILE
- if test 1886 -ne `wc -c <'TODO'`; then
- echo shar: \"'TODO'\" unpacked with wrong size!
- fi
- # end of 'TODO'
- fi
- if test ! -d 'bin' ; then
- echo shar: Creating directory \"'bin'\"
- mkdir 'bin'
- fi
- if test ! -d 'cfc' ; then
- echo shar: Creating directory \"'cfc'\"
- mkdir 'cfc'
- fi
- if test -f 'cfc/Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'cfc/Makefile'\"
- else
- echo shar: Extracting \"'cfc/Makefile'\" \(934 characters\)
- sed "s/^X//" >'cfc/Makefile' <<'END_OF_FILE'
- CC = cc
- CFLAGS = -g
- BINDIR = ../bin
- XEXTHDRS = /usr/include/ctype.h \
- X /usr/include/stdio.h
- HDRS =
- LDFLAGS =
- LIBS =
- LINKER = $(CC)
- MAKEFILE = Makefile
- OBJS = cfc.o
- PRINT = pr
- PROGRAM = cfc
- SRCS = cfc.c
- X#INSTALL = install -s
- INSTALL = cp
- all: $(PROGRAM)
- X
- X$(PROGRAM): $(OBJS) $(LIBS)
- X @echo -n "Loading $(PROGRAM) ... "
- X @$(LINKER) $(LDFLAGS) $(OBJS) $(LIBS) -o $(PROGRAM)
- X @echo "done"
- X
- lint:
- X lint cfc.c
- clean:; @rm -f $(OBJS) $(PROGRAM) core
- X
- depend:; @mkmf -f $(MAKEFILE) "CFLAGS=$(CFLAGS)" PROGRAM=$(PROGRAM) BINDIR=$(BINDIR)
- X
- index:; @ctags -wx $(HDRS) $(SRCS)
- X
- install: $(PROGRAM)
- X @echo Installing $(PROGRAM) in $(BINDIR)
- X ${INSTALL} $(PROGRAM) $(BINDIR)
- X
- print:; @$(PRINT) $(HDRS) $(SRCS)
- X
- program: $(PROGRAM)
- X
- tags: $(HDRS) $(SRCS); @ctags $(HDRS) $(SRCS)
- X
- X###
- cfc.o: /usr/include/stdio.h /usr/include/ctype.h
- END_OF_FILE
- if test 934 -ne `wc -c <'cfc/Makefile'`; then
- echo shar: \"'cfc/Makefile'\" unpacked with wrong size!
- fi
- # end of 'cfc/Makefile'
- fi
- if test ! -d 'debug' ; then
- echo shar: Creating directory \"'debug'\"
- mkdir 'debug'
- fi
- if test -f 'debug/Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'debug/Makefile'\"
- else
- echo shar: Extracting \"'debug/Makefile'\" \(988 characters\)
- sed "s/^X//" >'debug/Makefile' <<'END_OF_FILE'
- X# makefile for doing regression tests on sendmail files
- BINDIR=../bin
- X
- all: debug
- debug: good.out debug.out sendmail.cf
- X diff debug.out good.out
- X
- sendmail.ease: ../sendmail.ease
- X @echo getting your ease file from the top directory
- X cp ../sendmail.ease .
- sendmail.cf: sendmail.ease
- X ${BINDIR}/et -C sendmail.ease >sendmail.cf
- debug.out: debug.in sendmail.cf
- X showwhere < debug.in >debug.out
- debug.tbl: debug.out
- X echo ".TS" >debug.tbl
- X echo "l l l l l" >>debug.tbl
- X echo "l l l l l." >>debug.tbl
- X echo "Ruleset Input Mailer hostname User" >>debug.tbl
- X cat debug.out >>debug.tbl
- X echo ".TE" >>debug.tbl
- report: debug.tbl
- X tbl debug.tbl | ptroff
- X
- good.out:
- X @ echo you have to create this yourself by typing
- X @ echo " cp debug.out good.out"
- X @ echo do this once you feel your sendmail test suite
- X @ echo has results that you feel are correct
- X @ echo
- X @ echo do this everytime you feel you want to update
- X @ echo your test suite
- X @ cp good.out /dev/null
- X
- X
- clean:
- X rm debug.out debug.tbl
- END_OF_FILE
- if test 988 -ne `wc -c <'debug/Makefile'`; then
- echo shar: \"'debug/Makefile'\" unpacked with wrong size!
- fi
- # end of 'debug/Makefile'
- fi
- if test -f 'debug/debug.in' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'debug/debug.in'\"
- else
- echo shar: Extracting \"'debug/debug.in'\" \(396 characters\)
- sed "s/^X//" >'debug/debug.in' <<'END_OF_FILE'
- X0 user
- X0 user@localhost
- X0 user%localhost@localhost
- X0 barnett@crdgw1.ge.com
- X0 crdgw1.uucp!barnett
- X0 barnett@crdgw1.uucp
- X0 user@some.do.main
- X0 site!user%site2@site3.com
- X0 site1!site2!site3!user
- X0 site1!site2!site3!user@localhost
- X0 site1!site2!site3!user@machine.edu
- X0 site1!crd.ge.com!barnett
- X0 site1!crd.ge.com!barnett@crd.ge.com
- X0 user@bogus
- X22,4 user@crdgw1.UUCP Sender_via_UUCP
- END_OF_FILE
- if test 396 -ne `wc -c <'debug/debug.in'`; then
- echo shar: \"'debug/debug.in'\" unpacked with wrong size!
- fi
- # end of 'debug/debug.in'
- fi
- if test -f 'debug/showhow' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'debug/showhow'\"
- else
- echo shar: Extracting \"'debug/showhow'\" \(1262 characters\)
- sed "s/^X//" >'debug/showhow' <<'END_OF_FILE'
- X#!/bin/sh
- X# written by Bruce Barnett <barnett@crdgw1.ge.com>
- X# Inspired from
- X# Dan Long
- X# CSNET Technical Staff
- X# long@sh.cs.net
- X#
- X# This script converts the sendmail debug output into something
- X# easier to parse.
- X# Some sendmail programs output ^V, ^W, ^X
- X# This script converts ^V to $#, ^X to $:, and ^W to $@
- X# This matches Ultrix 3.1. SunOS 3.5 is different
- X# Other sendmail versions output in the $:, $@, $# format
- X# So this script just ignores those characters,
- X# as they are already correct.
- X#
- X#define your sendmail program compiled for debug
- SENDMAIL=/usr/lib/sendmail
- if [ $# -lt 2 ]
- then
- X echo 'Usage: showhow rulesets address [mailer]' 1>&2;exit 2;
- fi
- X#FLAGS='-d21.12'
- XFLAGS=''
- case $1 in
- X0*)
- X echo "$1 $2" | ${SENDMAIL} -bt -Csendmail.cf $FLAGS |\
- X egrep '\$\#|\^V' |\
- X tail -1 |tr -d '"' |\
- X sed \
- X -e 's/\^V/$#/' \
- X -e 's/\^X/$:/' \
- X -e 's/\^W/$@/' \
- X -e 's/^[a-zA-Z ][:a-zA-Z0-9 ]*//' \
- X -e 's/local \$:/local $@ local $:/' \
- X -e 's/\$# //' \
- X -e 's/ \$@ / /' \
- X -e 's/ \$: / /' \
- X -e 's/ //g'
- X ;;
- X*) # else a rewrite rule for a mailer
- X if [ X$3 = X ]
- X then
- X mailer='-';
- X else
- X mailer=$3;
- X fi
- X echo "$1 $2" | ${SENDMAIL} -bt -Csendmail.cf $FLAGS |\
- X egrep "^rewrite:"|tail -1 |tr -d '" '|\
- X sed "s/^.*:/$mailer /"
- X ;;
- esac
- X
- X
- X
- X
- END_OF_FILE
- if test 1262 -ne `wc -c <'debug/showhow'`; then
- echo shar: \"'debug/showhow'\" unpacked with wrong size!
- fi
- chmod +x 'debug/showhow'
- # end of 'debug/showhow'
- fi
- if test -f 'debug/showwhere' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'debug/showwhere'\"
- else
- echo shar: Extracting \"'debug/showwhere'\" \(207 characters\)
- sed "s/^X//" >'debug/showwhere' <<'END_OF_FILE'
- X#!/bin/sh
- X# Written By Bruce Barnett
- while :
- do
- X read username
- X# echo i just read in $username
- X if [ $? -eq 0 ]
- X then
- X x="`./showhow $username`"
- X echo $username $x | tr ' ' ' '
- X else
- X exit 0
- X fi
- done
- END_OF_FILE
- if test 207 -ne `wc -c <'debug/showwhere'`; then
- echo shar: \"'debug/showwhere'\" unpacked with wrong size!
- fi
- chmod +x 'debug/showwhere'
- # end of 'debug/showwhere'
- fi
- if test ! -d 'doc' ; then
- echo shar: Creating directory \"'doc'\"
- mkdir 'doc'
- fi
- if test -f 'doc/Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'doc/Makefile'\"
- else
- echo shar: Extracting \"'doc/Makefile'\" \(915 characters\)
- sed "s/^X//" >'doc/Makefile' <<'END_OF_FILE'
- X#! /bin/make -f
- X#
- X# $Header: /home/alydar/u0/barnett/Src/Ease/ease/doc/RCS/Makefile,v 1.2 1991/11/25 18:31:53 barnett Exp $
- X#
- X# $Log: Makefile,v $
- X# Revision 1.2 1991/11/25 18:31:53 barnett
- X# Changes by Paul A. Vixie
- X#
- X# Revision 1.1 1991/11/25 18:24:01 barnett
- X# Initial revision - from 1.2 version
- X#
- X#
- X#
- X# Makefile for Ease document.
- X#
- X# James S. Schoner
- X# Purdue University Computing Center
- X# Modifications by Paul A. Vixie <vixie@pa.dec.com>
- X#
- X
- XEXT=l
- MANDEST = /usr/man/man${EXT}
- ROFF=ptroff
- X
- DOCS = cover ease.paper ap1 ap2 ap3 ap4
- MANS = ease.man et.man cfc.man
- X
- all:; @echo "'all' is a no-op here. use install, printman, or printpaper"
- X
- install: ${MANS} FRC
- X install -c ease.man $(MANDEST)/ease.${EXT}
- X install -c et.man $(MANDEST)/et.${EXT}
- X install -c cfc.man $(MANDEST)/cfc.${EXT}
- X
- printpaper: ${DOCS} FRC
- X tbl ${DOCS} | ${ROFF} -ms
- X
- printman: ${MANS} FRC
- X tbl ${MANS} | ${ROFF} -man
- X
- clean:
- X
- XFRC:
- END_OF_FILE
- if test 915 -ne `wc -c <'doc/Makefile'`; then
- echo shar: \"'doc/Makefile'\" unpacked with wrong size!
- fi
- chmod +x 'doc/Makefile'
- # end of 'doc/Makefile'
- fi
- if test -f 'doc/ap1' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'doc/ap1'\"
- else
- echo shar: Extracting \"'doc/ap1'\" \(1490 characters\)
- sed "s/^X//" >'doc/ap1' <<'END_OF_FILE'
- X.DS C
- X\s+5\fBAppendix A\fR
- X
- X
- X\fBPre-Declared Macros\fR\s-5
- X.DE
- X.sp 5
- X.TS
- center box;
- c|c|c
- l|l|l.
- X\fBEase\fR Macro Raw Equivalent Meaning*
- X=
- X\fIm_odate\fR a The origination date in Arpanet format
- X\fIm_adate\fR b The current date in Arpanet format
- X\fIm_hops\fR c The hop count
- X\fIm_udate\fR d The date in UNIX (ctime) format
- X\fIm_smtp\fR e The SMTP entry message
- X\fIm_saddr\fR f The sender (from) address
- X\fIm_sreladdr\fR g The sender address relative to the recipient
- X\fIm_rhost\fR h The recipient host
- X\fIm_qid\fR i The queue id
- X\fIm_oname\fR j The official domain name for this site
- X\fIm_ufrom\fR l The format of the UNIX from line
- X\fIm_daemon\fR n The name of the daemon (for error messages)
- X\fIm_addrops\fR o The set of "operators" in addresses
- X\fIm_pid\fR p Sendmail's pid
- X\fIm_defaddr\fR q The default format of sender address
- X\fIm_protocol\fR r Protocol used
- X\fIm_shostname\fR s Sender's host name
- X\fIm_ctime\fR t A numeric representation of the current time
- X\fIm_ruser\fR u The recipient user
- X\fIm_version\fR v The version number of sendmail
- X\fIm_sitename\fR w The hostname of this site
- X\fIm_sname\fR x The full name of the sender
- X\fIm_stty\fR y The id of the sender's tty
- X\fIm_rhdir\fR z The home directory of the recipient
- X\fIm_domain\fR m The domain of the host (SunOS)
- X\fIm_uucpname\fR k The official UUCP name (IDA)
- X.TE
- X.FS
- X* Taken from pages 19 and 20 of the Sendmail Installation and Operation Guide
- X(SMM:7 in the 4.3 BSD UNIX System Manager's Manual), by Eric Allman.
- X.FE
- END_OF_FILE
- if test 1490 -ne `wc -c <'doc/ap1'`; then
- echo shar: \"'doc/ap1'\" unpacked with wrong size!
- fi
- # end of 'doc/ap1'
- fi
- if test -f 'doc/ap2' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'doc/ap2'\"
- else
- echo shar: Extracting \"'doc/ap2'\" \(3024 characters\)
- sed "s/^X//" >'doc/ap2' <<'END_OF_FILE'
- X...
- X... $Header: /tmp_mnt/home/kreskin/u0/barnett/Src/Ease/ease/doc/RCS/ap2,v 3.3 1991/09/09 16:36:05 barnett Exp $
- X...
- X... $Log: ap2,v $
- X... Revision 3.3 1991/09/09 16:36:05 barnett
- X... minor bug fixes
- X...
- X... Revision 2.1 1990/01/30 12:57:42 jeff
- X... Made changes corresponding to Ease release 2.1Alpha.
- X... se.
- X...
- X... Version 2.0 90/01/30 12:50:12 jeff
- X... Baseline version, corresponding to netwide release 2.0.
- X...
- X... Revision 1.5 88/06/15 10:11:53 root
- X... Added undocumented/unimplemented options. Fixed so it would troff well. ADR.
- X...
- X... Revision 1.4 88/01/21 17:10:33 root
- X... Added new option; change location of Sendmail doc to 4.3 SMM. ADR.
- X...
- X... Revision 1.3 87/09/04 14:55:36 root
- X... Fixed typo in new options. ADR.
- X...
- X... Revision 1.2 87/03/03 17:05:41 root
- X... Changes for 4.3 version of sendmail. ADR.
- X...
- X... Revision 1.1 87/03/03 17:01:24 root
- X... Initial revision
- X...
- X...
- X.DS C
- X\s+5\fBAppendix B\fR
- X
- X\fBSendmail Options\fR\s-5
- X.DE
- X.PP
- XFor a complete description of Sendmail's options and their values, refer to
- Appendix B of the Sendmail Installation and Operation Guide (SMM:7 in the
- X4.3 BSD UNIX System Manager's Manual), by Eric Allman.
- X.sp
- X.TS
- center box;
- c|c
- l|l.
- Sendmail Option (\fBEase\fR) Sendmail Option (Raw) Special Values
- X=
- X\fIo_alias\fR A
- X\fIo_ewait\fR a
- X\fIo_bsub\fR B
- X\fIo_checkpoint\fR C *
- X\fIo_qwait\fR c
- X\fIo_delivery\fR (special values below) d (special values below)
- X \fId_interactive\fR i
- X \fId_background\fR b
- X \fId_queue\fR q
- X\fIo_rebuild\fR D
- X\fIo_handling\fR (special values below) e (special values below)
- X \fIh_print\fR p
- X \fIh_exit\fR q
- X \fIh_mail\fR m
- X \fIh_write\fR w
- X \fIh_mailz\fR e
- X\fIo_tmode\fR F
- X\fIo_usave\fR f
- X\fIo_gid\fR g
- X\fIo_fsmtp\fR H
- X\fIo_skipd\fR i
- X\fIo_nameserver\fR I (HP/UX)
- X\fIo_slog\fR L
- X\fIo_rsend\fR m
- X\fIo_dnet\fR N (Ultrix)
- X\fIo_validate\fR n \(dg
- X\fIo_hformat\fR o
- X\fIo_pmaster\fR P \(bu
- X\fIo_qdir\fR Q
- X\fIo_qfactor\fR q
- X\fIo_tread\fR r
- X\fIo_flog\fR S
- X\fIo_safe\fR s
- X\fIo_qtimeout\fR T
- X\fIo_timezone\fR t
- X\fIo_dmuid\fR u
- X\fIo_verbose\fR v
- X\fIo_wizpass\fR W
- X\fIo_loadq\fR x
- X\fIo_loadnc\fR X
- X\fIo_recipfactor\fR y
- X\fIo_newproc\fR Y
- X\fIo_prifactor\fR z
- X\fIo_waitfactor\fR Z
- X\fIo_maxempty\fR b (SunOS)
- X\fIo_maxhops\fR h (SunOS)
- X\fIo_remote\fR R (SunOS)
- X\fIo_aliasfile\fR Y (SunOS)
- X\fIo_envelope\fR / (IDA)
- X
- X
- X
- X.TE
- X.PP
- X* This option is undocumented and unimplemented in 4.3BSD. It is
- for checkpointing mail after \fIN\fR failed connections. \fBEase\fR supports
- it in anticipation of future developments.
- Ultrix uses this flag in Ultrix 3.0. I assume it means the same thing.
- X.PP
- X\(dg This option is undocumented in 4.3BSD. It specifies that the right hand
- side of an alias definition should be checked for validity as an address
- when the alias database is being rebuilt.
- X.PP
- X\(bu This option is undocumented in 4.3BSD.
- It specifies the address of a Postmaster who should be carbon-copied on
- all returned bad mail.
- END_OF_FILE
- if test 3024 -ne `wc -c <'doc/ap2'`; then
- echo shar: \"'doc/ap2'\" unpacked with wrong size!
- fi
- # end of 'doc/ap2'
- fi
- if test -f 'doc/ap3' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'doc/ap3'\"
- else
- echo shar: Extracting \"'doc/ap3'\" \(1721 characters\)
- sed "s/^X//" >'doc/ap3' <<'END_OF_FILE'
- X...
- X... $Header: /isis/usr2/share/src/local/tc/ease/doc/RCS/ap3,v 2.1 90/01/30 12:57:45 jeff Exp $
- X...
- X... $Log: /isis/usr2/share/src/local/tc/ease/doc/RCS/ap3,v $
- X... Version 2.1 90/01/30 12:57:45 jeff
- X... Made changes corresponding to Ease release 2.1Alpha.
- X... se.
- X...
- X... Version 2.0 90/01/30 12:50:38 jeff
- X... Baseline version, corresponding to netwide release 2.0.
- X...
- X... Revision 1.4 88/06/15 10:12:22 root
- X... Added undocumented and unimplemented mailer flag.
- X...
- X... Revision 1.3 88/01/21 17:10:57 root
- X... Changed location of Sendmail doc to 4.3 SMM. ADR.
- X...
- X... Revision 1.2 87/03/03 17:05:53 root
- X... Changes for 4.3 version of sendmail. ADR.
- X...
- X... Revision 1.1 87/03/03 17:04:52 root
- X... Initial revision
- X...
- X...
- X.DS C
- X\s+5\fBAppendix C\fR
- X
- X
- X\fBMailer Flags\fR\s-5
- X.DE
- X.sp 5
- X.PP
- XFor a complete description of mailer flags, refer to
- Appendix C of the Sendmail Installation and Operation Guide (SMM:7 in the
- X4.3 BSD UNIX System Manager's Manual), by Eric Allman.
- X.sp 5
- X.TS
- center box;
- c|c
- l|l.
- Mailer Flag (\fBEase\fR) Mailer Flag (Raw)
- X=
- X\fIf_ffrom\fR f
- X\fIf_rfrom\fR r
- X\fIf_noreset\fR S
- X\fIf_noufrom\fR n
- X\fIf_locm\fR l
- X\fIf_strip\fR s
- X\fIf_mult\fR m
- X\fIf_from\fR F
- X\fIf_date\fR D
- X\fIf_mesg\fR M
- X\fIf_full\fR x
- X\fIf_return\fR P
- X\fIf_upperu\fR u
- X\fIf_upperh\fR h
- X\fIf_arpa\fR A
- X\fIf_ufrom\fR U
- X\fIf_expensive\fR e
- X\fIf_dot\fR X
- X\fIf_llimit\fR L
- X\fIf_retsmtp\fR p
- X\fIf_smtp\fR I
- X\fIf_addrw\fR C
- X\fIf_escape\fR E
- X\fIf_rport\fR R *
- X\fIf_mail11\fR H Ultrix 3.0
- X\fIf_relativize\fR V IDA
- X.TE
- X.FS
- X* This flag specifies the use of a reserved TCP port. In 4.3BSD it is
- both undocumented and unimplemented. \fBEase\fR supports it in anticipation
- of future developments.
- X.FE
- END_OF_FILE
- if test 1721 -ne `wc -c <'doc/ap3'`; then
- echo shar: \"'doc/ap3'\" unpacked with wrong size!
- fi
- # end of 'doc/ap3'
- fi
- if test -f 'doc/ap4' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'doc/ap4'\"
- else
- echo shar: Extracting \"'doc/ap4'\" \(273 characters\)
- sed "s/^X//" >'doc/ap4' <<'END_OF_FILE'
- X.DS C
- X\s+5\fBAppendix D\fR
- X
- X
- X\fBPre-Defined Classes\fR\s-5
- X.DE
- X.sp 5
- X.TS
- center box;
- c|c|c
- l|l|l.
- X\fBEase\fR Class Raw Equivalent Meaning
- X=
- X\fIc_myname\fR w The list of names by which this host is known
- X\fIc_mydomain\fR m The list of names by which this host is known
- X.TE
- END_OF_FILE
- if test 273 -ne `wc -c <'doc/ap4'`; then
- echo shar: \"'doc/ap4'\" unpacked with wrong size!
- fi
- # end of 'doc/ap4'
- fi
- if test -f 'doc/cover' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'doc/cover'\"
- else
- echo shar: Extracting \"'doc/cover'\" \(1034 characters\)
- sed "s/^X//" >'doc/cover' <<'END_OF_FILE'
- X...
- X... $Header: /home/alydar/u0/barnett/Src/Ease/ease/doc/RCS/cover,v 3.4 1991/11/25 18:17:56 barnett Exp $
- X...
- X... $Log: cover,v $
- X... Revision 3.4 1991/11/25 18:17:56 barnett
- X... added .bp at EOF
- X...
- X... Revision 3.3 1991/09/09 16:36:05 barnett
- X... minor bug fixes
- X...
- X... Revision 2.0 1990/01/30 12:50:41 jeff
- X... Baseline version, corresponding to netwide release 2.0.
- X...
- X... Revision 1.2 87/12/23 11:30:36 root
- X... Updated list of authors. ADR.
- X...
- X... Revision 1.1 87/12/23 10:16:35 root
- X... Initial revision
- X...
- X...
- X.DA
- X.sp 15
- X.nr PS 14
- X.ps 14
- X.DS C
- X
- X.DE
- X.sp 10
- X.nr PS 36
- X.ps 36
- X.DS C
- X\fBEase:\fR
- X.DE
- X.sp 5
- X.nr PS 22
- X.ps 22
- X.DS C
- A Configuration Language
- X
- for Sendmail
- X.DE
- X.sp 8
- X.nr PS 14
- X.ps 14
- X.DS C
- by
- X
- X\fIJames S. Schoner\fR
- X\fIPurdue University Computing Center\fR
- X
- Amended by
- X
- X\fIJeff P. Stearns\fR
- X\fIJohn Fluke Manufacturing Company\fR
- X
- X\fIArnold D. Robbins\fR
- X\fIEmory University Computing Center\fR
- X
- X\fIBruce G. Barnett\fR
- X\fIGeneral Electric\fR
- X\fICorporate Research and Development\fR
- X.DE
- X.bp
- END_OF_FILE
- if test 1034 -ne `wc -c <'doc/cover'`; then
- echo shar: \"'doc/cover'\" unpacked with wrong size!
- fi
- # end of 'doc/cover'
- fi
- if test -f 'doc/ease.man' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'doc/ease.man'\"
- else
- echo shar: Extracting \"'doc/ease.man'\" \(668 characters\)
- sed "s/^X//" >'doc/ease.man' <<'END_OF_FILE'
- X.\" @(#)ease.l (FLUKE) 25-feb-87
- X.\"
- X.TH EASE LOCAL "Feb 13, 1991"
- X.UC 4
- X.SH NAME
- ease \- precompiler for sendmail configuration files
- X.SH SYNOPSIS
- X.B ease
- X[
- X.B \-D
- X\fIname\fP[=\fIvalue\fP] ...
- X]
- file ...
- X.br
- X.SH DESCRIPTION
- X.I Ease
- compiles a high-level language into a form understood by
- X.I /usr/lib/sendmail.
- It is fully documented in the files which reside in the source directory.
- X.PP
- X.I Ease
- is actually a shell script which passes the source file through
- X.I cpp
- and thence into the actual ease translator
- X.I et.
- Output is printed to the standard output.
- X.SH "SEE ALSO"
- cpp(1), et(local), sendmail(8), cfc(local)
- X.SH BUGS
- X.SH BROUGHT TO YOU BY
- jeff@tc.fluke.COM
- END_OF_FILE
- if test 668 -ne `wc -c <'doc/ease.man'`; then
- echo shar: \"'doc/ease.man'\" unpacked with wrong size!
- fi
- # end of 'doc/ease.man'
- fi
- if test -f 'doc/et.man' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'doc/et.man'\"
- else
- echo shar: Extracting \"'doc/et.man'\" \(1305 characters\)
- sed "s/^X//" >'doc/et.man' <<'END_OF_FILE'
- X.\" @(#)et.man
- X.\"
- X.TH ET LOCAL "Feb 13, 1991"
- X.UC 4
- X.SH NAME
- et \- translator for sendmail configuration files
- X.SH SYNOPSIS
- X.B Et
- X[
- X.B \-d
- X]
- X[
- X.B \-q
- X]
- X[
- X.B \-D
- X\fIname\fP[=\fIvalue\fP] ...
- X]
- X[inputfile [outputfile]]
- X.br
- X.SH DESCRIPTION
- X.I Et
- compiles a high-level language into a form understood by
- X.I /usr/lib/sendmail.
- It is fully documented by the documentation provided with the program source.
- X.PP
- X.I Et
- optionally passes the source file through
- X.I cpp
- before parsing it. This allows all the power of
- X.I cpp
- to be applied to the input file.
- X.PP
- If no inputfile is specified, STDIN is used.
- If no outputfile is specified, STDOUT is used.
- The distinguished name "-" is synonymous with STDIN or STDOUT, as appropriate.
- X.PP
- By default,
- X.I Et
- passes input lines along into the output stream as comments.
- X.SH OPTIONS
- X.IP -d
- turns on the yydebug flag for the curious or desperate.
- X.IP -q
- turns off the feature which passes input lines along into the output
- stream as comments.
- X.PP
- X.I Et
- accepts the options of
- X.B cpp,
- and passes them along to the C pre-processor when it is invoked.
- X.B N.B
- If no such options are specified,
- X.B cpp
- is not invoked.
- X.SH "SEE ALSO"
- cpp(1), ease(local), sendmail(8), cfc(local)
- X.SH BUGS
- X.SH THIS MANUAL PAGE WRITTEN BY
- jeff@tc.fluke.com, from inspection of the source code.
- END_OF_FILE
- if test 1305 -ne `wc -c <'doc/et.man'`; then
- echo shar: \"'doc/et.man'\" unpacked with wrong size!
- fi
- # end of 'doc/et.man'
- fi
- if test ! -d 'src' ; then
- echo shar: Creating directory \"'src'\"
- mkdir 'src'
- fi
- if test -f 'src/fixstrings.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/fixstrings.c'\"
- else
- echo shar: Extracting \"'src/fixstrings.c'\" \(2012 characters\)
- sed "s/^X//" >'src/fixstrings.c' <<'END_OF_FILE'
- X/*
- X * $Revision: 2.2 $
- X * Check-in $Date: 1991/05/16 10:45:25 $
- X *
- X * $Author: barnett $
- X *
- X * $Log: fixstrings.c,v $
- X * Revision 2.2 1991/05/16 10:45:25 barnett
- X * Better support for System V machines
- X * Support for machines with read only text segments
- X *
- X * Revision 2.1 1990/01/30 14:25:14 jeff
- X * Comment changes only.
- X *
- X * Revision 2.0 88/06/15 14:41:19 root
- X * Baseline release for net posting. ADR.
- X *
- X * Version 1.2 87/02/25 16:55:13 jeff
- X * Add RCS header lines. No code changes.
- X *
- X */
- X#ifdef FLUKE
- X# ifndef LINT
- X static char RCSid[] = "@(#)FLUKE $Header: /home/kreskin/u0/barnett/Src/ease/src/RCS/fixstrings.c,v 2.2 1991/05/16 10:45:25 barnett Exp $";
- X# endif LINT
- X#endif FLUKE
- X
- X/* FLUKE jps 16-apr-86 - special hacks for NULL pointers.
- X *
- X * The author of ease used a *lot* of NULL pointers. This isn't much
- X * of a problem on a vax, where NULL pointers look like "". Not so on a Sun.
- X *
- X * We hack around the problem by defining a set of wrappers for the
- X * standard string functions, making it appear as though they accept NULL
- X * pointers. In the other C files, cpp macros are used to revector the
- X * standard string functions to this file.
- X */
- X#ifdef SYSV
- X#include <string.h>
- X#define index strchr
- X#define rindex strrchr
- X#else
- X#include <strings.h>
- X#endif
- X#define fix(s) ((s) ? (s) : "")
- X
- char *Xstrcat (s1, s2)
- char *s1, *s2;
- X{
- X return (strcat (s1, fix (s2)));
- X}
- X
- char *Xstrncat (s1, s2, n)
- char *s1, *s2;
- X{
- X return (strncat (s1, fix (s2), n));
- X}
- X
- XXstrcmp (s1, s2)
- char *s1, *s2;
- X{
- X return (strcmp (fix (s1), fix (s2)));
- X}
- X
- XXstrncmp (s1, s2, n)
- char *s1, *s2;
- X{
- X return (strncmp (fix (s1), fix (s2), n));
- X}
- X
- char *Xstrcpy (s1, s2)
- char *s1, *s2;
- X{
- X return (strcpy (s1, fix (s2)));
- X}
- X
- char *Xstrncpy (s1, s2, n)
- char *s1, *s2;
- X{
- X return (strncpy (s1, fix (s2), n));
- X}
- X
- XXstrlen (s)
- char *s;
- X{
- X return (strlen (fix (s)));
- X}
- X
- char *Xindex (s, c)
- char *s, c;
- X{
- X return (index (fix (s), c));
- X}
- X
- char *Xrindex (s, c)
- char *s, c;
- X{
- X return (rindex (fix (s), c));
- X}
- END_OF_FILE
- if test 2012 -ne `wc -c <'src/fixstrings.c'`; then
- echo shar: \"'src/fixstrings.c'\" unpacked with wrong size!
- fi
- # end of 'src/fixstrings.c'
- fi
- if test -f 'src/fixstrings.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/fixstrings.h'\"
- else
- echo shar: Extracting \"'src/fixstrings.h'\" \(1047 characters\)
- sed "s/^X//" >'src/fixstrings.h' <<'END_OF_FILE'
- X/*
- X * $Revision: 3.2 $
- X * Check-in $Date: 1991/05/16 10:45:25 $
- X * $State: Exp $
- X *
- X * $Author: barnett $
- X *
- X * $Log: fixstrings.h,v $
- X * Revision 3.2 1991/05/16 10:45:25 barnett
- X * Better support for System V machines
- X * Support for machines with read only text segments
- X *
- X * Revision 3.1 1991/02/25 22:09:52 barnett
- X * Fixed some portability problems
- X *
- X * Revision 2.1 1990/01/30 14:28:33 jeff
- X * Bring RCS version number in line with netwide version 2.1. No code
- X * changes.
- X *
- X * Revision 2.0 88/06/15 14:41:57 root
- X * Baseline release for net posting. ADR.
- X */
- X
- X/* FLUKE jps 16-apr-86 - revector the string routines to custom-coded ones
- X * which handle NULL pointers.
- X */
- X#ifdef SYSV
- X#define strchr Xindex
- X#define strrchr Xrindex
- X#else
- X#define index Xindex
- X#define rindex Xrindex
- X#endif
- X#define strcat Xstrcat
- X#define strncat Xstrncat
- X#define strcmp Xstrcmp
- X#define strncmp Xstrncmp
- X#define strcpy Xstrcpy
- X#define strncpy Xstrncpy
- X#define strlen Xstrlen
- X
- extern char *Xstrcpy();
- extern char *Xindex();
- extern char *Xstrcat();
- END_OF_FILE
- if test 1047 -ne `wc -c <'src/fixstrings.h'`; then
- echo shar: \"'src/fixstrings.h'\" unpacked with wrong size!
- fi
- # end of 'src/fixstrings.h'
- fi
- if test -f 'src/symtab.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/symtab.h'\"
- else
- echo shar: Extracting \"'src/symtab.h'\" \(2671 characters\)
- sed "s/^X//" >'src/symtab.h' <<'END_OF_FILE'
- X/*
- X * symtab.h -- Definitions related to the "et" symbol table.
- X *
- X * author -- James S. Schoner, Purdue University Computing Center,
- X * West Lafayette, Indiana 47907
- X *
- X * date -- July 1, 1985
- X *
- X * Copyright (c) 1985 by Purdue Research Foundation
- X *
- X * All rights reserved.
- X *
- X * $Log: symtab.h,v $
- X * Revision 3.0 1991/02/22 18:50:27 barnett
- X * Added support for HP/UX and IDA sendmail.
- X *
- X * Revision 2.1 1990/01/30 15:58:35 jeff
- X * Added SunOS/Ultrix/IDA extensions Jan 24, 1989 Bruce Barnett
- X *
- X * Revision 2.0 88/06/15 14:43:08 root
- X * Baseline release for net posting. ADR.
- X */
- X
- X#define TRUE 1
- X#define FALSE 0
- X#define SST 101 /* size of hash table (symbol table) */
- X#define RSNMAX 5 /* size of a ruleset number character buffer */
- X#define VALRSNMAX 9999 /* max value of ruleset number */
- X
- X
- X/* identifier types */
- X#define ID_UNTYPED 0
- X#define ID_MACRO 01
- X#define ID_CLASS 02
- X#define ID_RULESET 04
- X#define ID_FIELD 010
- X#define ID_PREC 020
- X#define ID_MAILER 040
- X
- X/* identifier type macros */
- X#define ISTYPED(x) (x|ID_UNTYPED)
- X#define ISMACRO(x) (x&ID_MACRO)
- X#define ISCLASS(x) (x&ID_CLASS)
- X#define ISRULESET(x) (x&ID_RULESET)
- X#define ISFIELD(x) (x&ID_FIELD)
- X#define ISPREC(x) (x&ID_PREC)
- X#define ISMAILER(x) (x&ID_MAILER)
- X
- X/* block definition types */
- enum bdefs {def_macro, def_class, def_option, def_prec, def_trusted,
- X def_header, def_mailer, def_ruleset};
- X
- X/* option types */
- enum opts {opt_A, opt_a, opt_B, opt_C, opt_c, opt_D, opt_d, opt_e, opt_F,
- X opt_f, opt_g, opt_H, opt_i, opt_L, opt_m, opt_N, opt_n, opt_o,
- X opt_P, opt_Q, opt_q, opt_r, opt_S, opt_s, opt_T, opt_t, opt_u,
- X opt_v, opt_W, opt_x, opt_X, opt_Y, opt_y, opt_Z, opt_z,
- X opt_b, opt_R, opt_SL, opt_h, opt_I,
- X d_opt_i, d_opt_b, d_opt_q,
- X e_opt_p, e_opt_e, e_opt_m, e_opt_w, e_opt_z};
- X
- X/* flag types */
- enum flgs {flg_f, flg_r, flg_S, flg_n, flg_l, flg_s, flg_m, flg_F, flg_D,
- X flg_M, flg_x, flg_P, flg_u, flg_h, flg_A, flg_U, flg_e, flg_X,
- X flg_H, flg_V, flg_B,
- X flg_L, flg_p, flg_I, flg_C, flg_E, flg_R};
- X
- X/* mailer parameters */
- enum mats {mat_path, mat_flags, mat_sender, mat_recipient, mat_argv,
- X mat_eol, mat_maxsize};
- X
- struct he { /* hash entry structure for symbol table node */
- X unsigned idtype; /* identifier type */
- X unsigned idd; /* identifier definition flag */
- X char *psb; /* identifier string buffer */
- X union {
- X char rsn[RSNMAX]; /* ruleset number */
- X int prec; /* precedence value */
- X char idc; /* one char id representation */
- X char *fstring; /* field string */
- X } idval;
- X struct he *phe; /* next hash entry */
- X};
- END_OF_FILE
- if test 2671 -ne `wc -c <'src/symtab.h'`; then
- echo shar: \"'src/symtab.h'\" unpacked with wrong size!
- fi
- # end of 'src/symtab.h'
- fi
- if test ! -d 'test' ; then
- echo shar: Creating directory \"'test'\"
- mkdir 'test'
- fi
- if test -f 'test/README' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'test/README'\"
- else
- echo shar: Extracting \"'test/README'\" \(1583 characters\)
- sed "s/^X//" >'test/README' <<'END_OF_FILE'
- This is my little package to work out what is going on inside sendmail.
- It consists of a sendmail configuration file and a shell script. The sendmail
- configuration file was created with ease (see previous messages in net.mail
- about ease - i think it's due in mod.sources). The ease source is included.
- X
- What this is all about:
- X
- X I was having difficulty creating a sendmail.cf. So, I wrote a
- sendmail.cf whose sole function was to tag an address as it went through the
- ruleset. I coupled this with a little shell script, called args, which snarfs
- it's arguments (and stdin) and write them to a log file (/tmp/log is what I
- have used - you can alter it to taste, bearing in mind that it will probably
- have to suid to write to your directory :-()
- X
- What do you do:
- X
- X Unpack all this junk. You should have test.mc, test.cf, args and
- README. Put args in your search path. Create a dummy mail message. It helps
- to know how you mailer calls sendmail. I used args to find out. (I briefly
- replaced /usr/lib/sendmail with args and sent some mail). Call sendmail with
- the dummy mail item as stdin. ie:
- X
- X /usr/lib/sendmail -Ctest.cf foobar <<eof
- X To: foobar
- X Subject: test
- X
- X test mail
- X eof
- X
- then have a look at what is in /tmp/log
- X
- Thats all there is folks. I also use args with real configuration files, so
- that I can test them without disrupting the mail service through my machine.
- If you have any problems with this stuff, mail me and I'll try and help.
- X
- X Simon Kenyon
- X The National Software Centre,
- X 28 Enterprise Centre,
- X Pearse Street,
- X Dublin 2
- X IRELAND
- X +353 1 716255
- X simon@einode.UUCP
- END_OF_FILE
- if test 1583 -ne `wc -c <'test/README'`; then
- echo shar: \"'test/README'\" unpacked with wrong size!
- fi
- # end of 'test/README'
- fi
- if test -f 'test/args' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'test/args'\"
- else
- echo shar: Extracting \"'test/args'\" \(507 characters\)
- sed "s/^X//" >'test/args' <<'END_OF_FILE'
- X#!/bin/sh
- X#
- X# little shell script to snarf it's arguments and stdin and put them
- X# in a log file. this way you can see what is being given to the various
- X# mailers and also what is being done to addresses.
- X# it's a real hack, but it works for me
- X#
- X# Simon Kenyon, The NSC, Dublin, IRELAND. 24th Nov 86
- X#
- echo '-------------'`date`'------------------' >>/tmp/log
- echo -n "Command line: " >>/tmp/log
- for i in "$@"
- do
- echo -n "$i " >>/tmp/log
- done
- echo >>/tmp/log
- while read foo
- do
- echo $foo >>/tmp/log
- done
- END_OF_FILE
- if test 507 -ne `wc -c <'test/args'`; then
- echo shar: \"'test/args'\" unpacked with wrong size!
- fi
- # end of 'test/args'
- fi
- if test -f 'test/test.addresses' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'test/test.addresses'\"
- else
- echo shar: Extracting \"'test/test.addresses'\" \(210 characters\)
- sed "s/^X//" >'test/test.addresses' <<'END_OF_FILE'
- X#! /bin/sh
- X
- X/usr/lib/sendmail -bt -Csun.cf \
- X| awk \
- X '/^> >/ {printf "\n\n"};
- X {print}
- X ' \
- X| sed \
- X -e 's/ \$# / mailer = /' \
- X -e 's/ \$: / user = /' \
- X -e 's/ \$@ / host = /'
- X
- END_OF_FILE
- if test 210 -ne `wc -c <'test/test.addresses'`; then
- echo shar: \"'test/test.addresses'\" unpacked with wrong size!
- fi
- chmod +x 'test/test.addresses'
- # end of 'test/test.addresses'
- fi
- if test -f 'test/test.cf' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'test/test.cf'\"
- else
- echo shar: Extracting \"'test/test.cf'\" \(2437 characters\)
- sed "s/^X//" >'test/test.cf' <<'END_OF_FILE'
- X###################################################
- X## ##
- X## WARNING: THIS FILE IS TO BE MODIFIED BY ##
- X## THE EASE TRANSLATOR (ET) ONLY. ##
- X## ##
- X## ALL OTHER MODIFICATIONS WILL ##
- X## DISAPPEAR THE NEXT TIME ET IS RUN. ##
- X## ##
- X## MAKE MODIFICATIONS TO THE EASE ##
- X## SOURCE ONLY. ##
- X## ##
- X###################################################
- DAmy_domain
- DBruleset tester V1.0
- Dwwhatever
- Dj$w.$A
- DnMAILER-DAEMON
- DlFrom $g $d
- Do.:%@!^=/[]{}
- Dq$?x$x <$g>$|$g$.
- De$j Sendmail $v/$B ready at $b
- OA/usr/lib/aliases
- Odb
- Ou1
- OS/usr/lib/sendmail.st
- OH/usr/lib/sendmail.hf
- Og1
- Oo
- OQ/usr/spool/mqueue
- OT3d
- Os
- OL9
- OtWET
- OF0644
- Orr2h
- OW*
- Pfirst-class=0
- Pspecial-delivery=100
- Pjunk=-100
- Troot daemon uucp network
- Tsimon
- Ha: The origination date in Arpanet format = $a
- Hb: The current date in Arpanet format = $b
- Hc: The hop count = $c
- Hd: The date in UNIX (ctime) format = $d
- He: The SMTP entry message = $e
- Hf: The sender (from) address = $f
- Hg: The sender address relative to the recipient = $g
- Hh: The recipient host = $h
- Hi: The queue id = $i
- Hj: The official domain name for this site = $j
- Hl: The format of the UNIX from line = $l
- Hn: The name of the daemon (for error messages) = $n
- Ho: The set of operators in addresses = $o
- Hp: Sendmail's pid = $p
- Hq: The default format of sender address = $q
- Hr: Protocol used = $r
- Hs: Sender's host name = $s
- Ht: A numeric representation of the current time = $t
- Hu: The recipient user = $u
- Hv: The version number of sendmail = $v
- Hw: The hostname of this site = $w
- Hx: The full name of the sender = $x
- Hy: The id of the sender's tty = $y
- Hz: The home directory of the recipient = $z
- S3
- R$+ $:{3}$1
- S0
- R$+@$+ $#uucp$@{0_uucp}$2$:{0_uucp}$1
- R$+!$+ $#uucp$@{0_uucp}$1$:{0_uucp}$2
- R$+ $#local$:{0_local}$1
- S1
- R$+ $@{1}$1
- S2
- R$+ $@{2}$1
- S4
- R$+ $@{4}$1
- S10
- R$+ $@{S_local}$1
- S20
- R$+ $@{R_local}$1
- S11
- R$+ $@{S_uucp}$1
- S21
- R$+ $@{R_uucp}$1
- Mlocal, P=/usr/src/local/EUnet/ease/test/args, F=DFlMmnrs, S=10, R=20, A=args mail -d $u
- Mprog, P=/usr/src/local/EUnet/ease/test/args, F=DeFlMns, S=10, R=20, A=args sh -c $u
- Muucp, P=/usr/src/local/EUnet/ease/test/args, F=DFMsUhu, S=11, R=21, M=65535, A=args uumail -h -oc -gA -f$g $h!$u
- END_OF_FILE
- if test 2437 -ne `wc -c <'test/test.cf'`; then
- echo shar: \"'test/test.cf'\" unpacked with wrong size!
- fi
- # end of 'test/test.cf'
- fi
- if test ! -d 'utils' ; then
- echo shar: Creating directory \"'utils'\"
- mkdir 'utils'
- fi
- if test -f 'utils/Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'utils/Makefile'\"
- else
- echo shar: Extracting \"'utils/Makefile'\" \(204 characters\)
- sed "s/^X//" >'utils/Makefile' <<'END_OF_FILE'
- X
- BINDIR=../bin
- X#INSTALL=install -m 755
- INSTALL=cp
- X
- all:
- clean:
- X
- install:
- X ${INSTALL} cfdiff.sh ${BINDIR}/cfdiff
- X ${INSTALL} cfstrip.sh ${BINDIR}/cfstrip
- X chmod 755 ${BINDIR}/cfstrip ${BINDIR}/cfdiff
- X
- END_OF_FILE
- if test 204 -ne `wc -c <'utils/Makefile'`; then
- echo shar: \"'utils/Makefile'\" unpacked with wrong size!
- fi
- # end of 'utils/Makefile'
- fi
- if test -f 'utils/build-new-aliases' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'utils/build-new-aliases'\"
- else
- echo shar: Extracting \"'utils/build-new-aliases'\" \(1226 characters\)
- sed "s/^X//" >'utils/build-new-aliases' <<'END_OF_FILE'
- X#!/bin/csh -f
- X# build-new-aliases
- X# Bruce Barnett
- X#
- X# this script makes a new alias file
- X#
- X# first it has to shutdown sendmail
- X# But do it nicely, using kill -15 at first.
- X
- X# how many sendmail processes are running?
- set j = (`ps ax |grep sendmail|grep -v grep`);
- X
- set loopcount = 0
- if ( $#j > 0 ) then
- X
- loop:
- X@ loopcount++
- X # wait 30 * 30 seconds for all of the sendmail processes to quit
- X if ( $loopcount > 30 ) then
- X echo ERROR - can not kill sendmail
- X goto problem
- X endif
- X kill -15 $j[1]
- X sleep 30
- X set j = (`ps ax |grep sendmail|grep -v grep`);
- X if ( $#j > 0 ) then
- X goto loop
- X endif
- endif
- goto good
- problem:
- X# could not kill sendmail - try something drastic
- X echo `date` kill sendmail >>/usr/spool/adm/build-new-aliases.log
- X kill -9 $j[1]
- good:
- set frozen = 0
- if ( -f /etc/sendmail.fc ) then
- X set frozen = 1
- X /bin/cp /dev/null /etc/sendmail.fc
- endif
- X# clean up any lock files
- touch /usr/spool/mqueue/lf0
- X/bin/rm -f /usr/spool/mqueue/lf*
- X
- X# see the documentation about the 'a' option of sendmail
- X# or the "D" option
- X#/usr/lib/newaliases
- X# rebuild aliases
- X/usr/lib/sendmail -bi
- X
- if ( $frozen > 0 ) then
- X /usr/lib/sendmail -bz
- endif
- X
- X# restart the daemon with 30 minutes between cycles
- X/usr/lib/sendmail -bd -q30m -om
- END_OF_FILE
- if test 1226 -ne `wc -c <'utils/build-new-aliases'`; then
- echo shar: \"'utils/build-new-aliases'\" unpacked with wrong size!
- fi
- chmod +x 'utils/build-new-aliases'
- # end of 'utils/build-new-aliases'
- fi
- if test -f 'utils/cfdiff.sh' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'utils/cfdiff.sh'\"
- else
- echo shar: Extracting \"'utils/cfdiff.sh'\" \(523 characters\)
- sed "s/^X//" >'utils/cfdiff.sh' <<'END_OF_FILE'
- X#!/bin/sh
- X# Bruce Barnett
- X# usage:
- X# cfdiff file1.cf file2.cf
- X# this removes all comments from the cf file
- case $# in
- X 0|1)
- X echo usage: cfdiff file1 file2;
- X exit 1
- X ;;
- esac
- X[ ! -f $1 ] && {
- X echo file $1 does not exist;
- X exit 1;
- X};
- X[ ! -f $2 ] && {
- X echo file $2 does not exist;
- X exit 1;
- X}
- X# if SunOS, use the -b -w option
- DIFF="diff -b"
- ARG1=`basename $1`
- ARG2=`basename $2`
- X[ $ARG1 = $ARG2 ] && {
- X ARG2=$ARG2-
- X}
- cfstrip <$1>/tmp/$ARG1
- cfstrip <$2>/tmp/$ARG2
- X
- cd /tmp
- X${DIFF} $ARG1 $ARG2
- X
- X/bin/rm /tmp/$ARG1 /tmp/$ARG2
- END_OF_FILE
- if test 523 -ne `wc -c <'utils/cfdiff.sh'`; then
- echo shar: \"'utils/cfdiff.sh'\" unpacked with wrong size!
- fi
- chmod +x 'utils/cfdiff.sh'
- # end of 'utils/cfdiff.sh'
- fi
- if test -f 'utils/cfstrip.sh' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'utils/cfstrip.sh'\"
- else
- echo shar: Extracting \"'utils/cfstrip.sh'\" \(686 characters\)
- sed "s/^X//" >'utils/cfstrip.sh' <<'END_OF_FILE'
- X#!/bin/sh
- X# usage:
- X# cfstrip <infile >outfile
- X# Bruce Barnett
- X#
- X# this file strips out all comments from a sendmail.cf file
- X# it also converts
- X# <tab>[whitespace] to <tab>
- X# <space>[whitespace] to <space>
- X# <space>$ to $
- X# <space>< to <
- X# <space>@ to @
- case $# in
- X 0)
- X ;;
- X *)
- X echo no arguments are allowed;
- X exit 1
- X ;;
- esac
- sed -e '
- s/^#.*//
- s/^\(R[^ ]*[ ][ ]*[^ ]*\)[ ]*.*$/\1/
- s/^\(R[^ ]*[ ][ ]*[^ ]*\)[ ]*$/\1/
- s/^\(R[^ ]*[ ][ ]*[^ ]*\)$/\1/
- s/ [ ]*/ /g
- s/ [ ]*/ /g
- s/ \$/$/g
- s/ </</g
- s/ @/@/g
- X# convert multiple tabs into one tab
- s/ */ /g
- X# this one will really remove most spaces
- s/^R\([^ ]*\) \([^ ]*\)/R\1\2/g
- X# remove a space in "T root"
- s/^T */T/
- X/^[ ]*$/d
- X'
- END_OF_FILE
- if test 686 -ne `wc -c <'utils/cfstrip.sh'`; then
- echo shar: \"'utils/cfstrip.sh'\" unpacked with wrong size!
- fi
- chmod +x 'utils/cfstrip.sh'
- # end of 'utils/cfstrip.sh'
- fi
- echo shar: End of archive 1 \(of 6\).
- cp /dev/null ark1isdone
- MISSING=""
- for I in 1 2 3 4 5 6 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 6 archives.
- rm -f ark[1-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-