[alt.sources] Anonymous Contact Service software v1.1, Part02/08

csu@alembic.acs.com (Dave Mack) (07/16/90)

This is the second distribution of the Anonymous Contact Service
software. The distribution consists of 8 shar files. This will
(hopefully) be the last full distribution of the system - all
future versions will be distributed as patches. The patchlevel of
this version is 1.

The ACS software provides a mechanism for posting anonymous articles,
for receiving replies to those articles which are also anonymous, and
permits prolonged anonymous conversations in which neither writer knows
the other's actual e-mail address.

This software is currently being used to provide an anonymous personals
service in alt.personals.

Dave Mack
csu@alembic.ACS.COM

#! /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 2 (of 8)."
# Contents:  INSTALL Intro-short Makefile mailer/Flow.Diagram
#   mailer/Install mailer/getopt.c mailer/getpath.c mailer/make.cf.sh
#   mailer/map.c mailer/nptx.8 mailer/patch.dotname mailer/paths.8
#   mailer/svbinmail.c
# Wrapped by csu@alembic on Sun Jul 15 12:46:43 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'INSTALL' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'INSTALL'\"
else
echo shar: Extracting \"'INSTALL'\" \(2547 characters\)
sed "s/^X//" >'INSTALL' <<'END_OF_FILE'
XInstalling the Anonymous Contact Service Software
X
XThroughout the following, it is assumed that you are su to "root". If
Xyou don't have root privileges, none of this will work.
X
X1) create a directory for the ACS (I use /usr/personals, you can use
X   just about anything), cd into it, and unshar the ACS distribution.
X   It would probably be best not to delete the sharfiles just yet, as
X   some of the installation stuff hasn't been tested too thoroughly.
X
X2) In the mailer subdirectory, read the smail2.5 installation instructions
X   and edit defs.h as if you were setting up smail. If you already run
X   smail (and it works), just use the defs.h file from your current
X   smail configuration. DO NOT DO A "make" in the mailer subdirectory.
X   When you're done, return to the directory created in Step 1.
X
X3) Edit config.perl and change $NEWBASEDIR to the name of the directory
X   containing the ACS source, $NEWHOSTNAME to the hostname of your system,
X   and $NEWDOMAIN to the domainname of your system.
X
X4) type "config.perl".
X
X5) type "make all".
X
X6) Add the lines in "aliases" to /usr/lib/aliases. You may have to run
X   newaliases if your sendmail isn't configured to automatically update
X   the aliases dbm files. You should strongly consider adding the "OD"
X   option to your sendmail.cf file and restarting sendmail.
X
X7) Add the lines in "crontab" to /usr/lib/crontab (or 
X   /usr/spool/cron/crontabs/root if you have the terrible misfortune to be
X   using a SYSVish system.)
X
X8) Check the permissions on the files in the acs directory. anon-post,
X   anon-reply, and anon-ping should run suid root. Nothing should be
X   writable by "other". During testing, make sure that the spool and
X   repair directories are drwx------, and the real2alias.{dir,pag} files 
X   are -rw-------.
X
X9) Test the system thoroughly before taking it public, particularly
X   if you've had to make significant modifications to get it to work.
X
X10) When you feel you're ready for a test that extends beyond your own
X   system, edit "unspool" and find this line (approx. line 130):
X
X	print INEWS "Distribution: local\n";
X
X   Change "local" to whatever distribution you intend anonymous postings
X   to go to.
X
X11) Post your version of the Intro message to alt.personals with
X   whatever distribution you've decided on. Stand back and watch 
X   your computer melt.
X
X11) If you have to do *anything* to get the system working beyond what
X   is presented in these instructions, please send the diffs (context
X   preferred) to csu@alembic.ACS.COM.
X
XGood luck,
XDave Mack
END_OF_FILE
if test 2547 -ne `wc -c <'INSTALL'`; then
    echo shar: \"'INSTALL'\" unpacked with wrong size!
fi
# end of 'INSTALL'
fi
if test -f 'Intro-short' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Intro-short'\"
else
echo shar: Extracting \"'Intro-short'\" \(1745 characters\)
sed "s/^X//" >'Intro-short' <<'END_OF_FILE'
XSubject: Using the alt.personals Anonymous Contact Service - The short form
XNewsgroups: alt.personals
XFrom: csu@alembic.ACS.COM
XDistribution: world
XFollowup-To: alt.personals
XOrganization: Anonymous Contact Service
XReply-To: csu@alembic.ACS.COM
X
XTo post a NON-anonymous article to alt.personals:
X
X	Just post like you would to any other group.
X	alt.personals is not moderated.
X
XTo post an anonymous article to alt.personals:
X
X	E-MAIL your article to acs-post@alembic.ACS.COM.
X	Article must be 25 lines or less (not counting the header).
X	Anything after a line containing "-- " is considered
X	signature and is removed.
X
XTo send e-mail to an anonymous poster or to anyone with an alias:
X
X	Just send e-mail to the alias as you would normally send e-mail.
X	The message must be 25 lines or less (not counting the header).
X	Anything after a line containing "-- " is considered 
X	signature and removed.
X
XTo find out if you can get mail to and from alembic, or to find out
Xwhat your alias would be if you did post a personal:
X
X	Send e-mail to "acs-ping@alembic.ACS.COM".
X	Doesn't matter what's in the body of the message, no one
X	ever sees it.
X
XTo get help, make suggestions, complain, etc.:
X
X	Send e-mail to "acs-admin@alembic.ACS.COM".
X
XIf your user name contains any the strings "uucp", "news", "mailer",
X"deliver", "daemon", "root", or "postmaster", in either upper or
Xlower case, or some combination, anything you send to acs-post, acs-ping,
Xor an alias will be shoved in the bitbucket for recycling. Send
Xfrom an account with some other username.
X
XI would strongly suggest reading the "Long Form" version of the
XIntro to the ACS before you try posting anonymously.
X
X-- 
XDave Mack
Xcsu@alembic.acs.com
Xacs-a@alembic.acs.com
Xuunet!alembic!{csu,acs-a}
END_OF_FILE
if test 1745 -ne `wc -c <'Intro-short'`; then
    echo shar: \"'Intro-short'\" unpacked with wrong size!
fi
# end of 'Intro-short'
fi
if test -f 'Makefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Makefile'\"
else
echo shar: Extracting \"'Makefile'\" \(1626 characters\)
sed "s/^X//" >'Makefile' <<'END_OF_FILE'
X# Makefile for the Anonymous Contact Service software
X#
X# Dependencies:
X#	all	builds the entire ACS software suite
X#	clean	removes .o files, core files, and clobbers the mailer directory
X#	clobber	removes all binaries in addition to cleaning
X#	newacs	destroys the existing aliases data base (VERY DANGEROUS)
X#
X#	To build the ACS software, type "make all" followed by
X#	"make clean". You should be root when you build it to get
X#	the permissions right.
X#
X#	To restart the system after offline testing, type "make newacs",
X#	NEVER EVER run "make newacs" in a live system. It destroys the
X#	aliases database and the aliases-index file.
X#
X# Dave Mack
X# csu@alembic.ACS.COM
X#
X
XCFLAGS = -O
X
XBINARIES = anon-post anon-reply anon-ping acsmail
X
Xall: $(BINARIES)
X	chmod a+x addalias config.perl fixit listr2a rmbyaddr rmbyalias \
X	nextalias unspool
X	mkdir spool repair
X	chmod go-rwx spool repair
X
Xanon-post: anon-post.o
X	cc -o anon-post anon-post.o
X	chmod u+s anon-post
X
Xanon-ping: anon-ping.o
X	cc -o anon-ping anon-ping.o
X	chmod u+s anon-ping
X
Xanon-reply: anon-reply.o
X	cc -o anon-reply anon-reply.o
X	chmod u+s anon-reply
X
Xacsmail:
X	(cd mailer; make -f Makefile.acs install; make -f Makefile.acs clobber)
X
Xclean:
X	rm -f *.o core
X	(cd mailer; make -f Makefile.acs clobber)
X
Xclobber: clean
X	rm -f $(BINARIES)
X
Xnewacs:
X	@echo "This will destroy the existing aliases database."
X	@echo "If this is not what you want to do, you have 10"
X	@echo "seconds to kill this process."
X	sleep 10
X	@echo "Removing real2alias database and alias-index
X	rm -f real2alias.* alias-index
X	@echo "You need to edit /usr/lib/aliases by hand and run newaliases"
END_OF_FILE
if test 1626 -ne `wc -c <'Makefile'`; then
    echo shar: \"'Makefile'\" unpacked with wrong size!
fi
# end of 'Makefile'
fi
if test -f 'mailer/Flow.Diagram' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'mailer/Flow.Diagram'\"
else
echo shar: Extracting \"'mailer/Flow.Diagram'\" \(2665 characters\)
sed "s/^X//" >'mailer/Flow.Diagram' <<'END_OF_FILE'
Xvanilla 4.2BSD mail flow
X
XLOCAL   /bin/mail ----                           -- /bin/mail -- LOCAL
X                      \                        / 
X                       ----------- sendmail --
X                      /          /             \
XLOCAL   Mail ---------          /                -- uux -------- REMOTE
X                               /
XREMOTE  /bin/rmail ------------
X
X==========================
X
Xsmail 4.2BSD mail flow
X
XLOCAL   /bin/mail                          -- /bin/mail -- LOCAL
X                 \                        /
X                  ------------ sendmail --
X                 /          /             \
XLOCAL   Mail ---          /                -- /bin/smail -
X                         /  (non-bang)                    \
XREMOTE  /bin/rmail ------                                  \
X                          \  (bang)                          \
X		           ------------------------------------- uux REMOTE
X
X==========================
X
Xvanilla SVR2 mail flow
X
X		mail	is "/usr/src/cmd/mail.c"
X		rmail	is linked to mail
X
XLOCAL	mail  ------------\              /--------------------- LOCAL
X		           \            /
XLOCAL	mailx ----> mail ---+----------+
X		           /            \
XREMOTE	rmail ------------/              \-- uux -------------- REMOTE
X
X==========================
X
XModified SVR2 mail flow using SENDMAIL
X
XDefinitions of changed/renamed programs
X
X		mail	is "svbinmail.c"
X		lmail	is "/usr/src/cmd/mail.c"
X		rmail	is linked to smail
X
XLOCAL	mail  ------------\                /-- lmail ---------- LOCAL
X		           \              /
X                            +--sendmail--+
X		           /              \
XLOCAL	mailx --- mail ---/                \-- smail -- uux --- REMOTE
X
X
X                                               /-- lmail ------ LOCAL
X                                              /
X                                /--sendmail--+
X                               /              \
X                              /                \- smail - uux - REMOTE
X                             / (domain | LOCAL)
XREMOTE  rmail --------------+
X                             \ (bang)
X                              \
X                               \------------------ uux -------- REMOTE
X
X==========================
X
XModified SVR2 mail flow without SENDMAIL
X
XLOCAL	mail  ------------\                /-- lmail ---------- LOCAL
X		           \              /
X                            +-- rmail ---+
X		           /    /         \
XLOCAL	mailx --- mail ---/    /           \-- uux ----------- REMOTE
X                              /
X                             /
XREMOTE	--------------------+
X
X#
X# @(#)Flow.Diagram	2.5 (smail) 9/15/87
X#
END_OF_FILE
if test 2665 -ne `wc -c <'mailer/Flow.Diagram'`; then
    echo shar: \"'mailer/Flow.Diagram'\" unpacked with wrong size!
fi
# end of 'mailer/Flow.Diagram'
fi
if test -f 'mailer/Install' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'mailer/Install'\"
else
echo shar: Extracting \"'mailer/Install'\" \(2181 characters\)
sed "s/^X//" >'mailer/Install' <<'END_OF_FILE'
XThere are three system types on which smail can be installed.
X
X	(1) Berkeley with sendmail
X	(2) System V with sendmail
X	(3) System V without sendmail
X
X	Note: if you have a System III or V7 derived system, you
X	can probably treat it like (3).  We have not tested smail
X	on such a system.
X
XThe installation will vary slightly for each system type.
X
XFor all systems you first have to create a 'paths' database.
XSee paths(8) for details on the file's format.  Then
Xcopy it to /usr/lib/uucp/paths.
X
XNext, edit "defs.h" to configure smail to suit your situation.
X
XHere are step by step installation instructions for each system type.
X
X(1) For a berkeley system with sendmail, the steps are:
X
X	$ make
X
X	$ cp smail /bin/smail
X
X	$ sh make.cf.sh
X		<answer the questions it asks>
X
X	$ mv /usr/lib/sendmail.cf /usr/lib/OLDsendmail.cf
X
X	$ cp sendmail.cf /usr/lib/sendmail.cf
X
X	$ /usr/lib/sendmail -bz
X
X	$ mv /bin/rmail /bin/OLDrmail
X
X	$ ln /bin/smail /bin/rmail
X
X(2) For a System V system with sendmail, the steps are:
X
X	$ make
X
X	$ cp smail /bin/smail
X
X	$ ln /bin/mail /bin/lmail
X
X	$ sh make.cf.sh
X		<answer the questions it asks>
X
X	$ mv /usr/lib/sendmail.cf /usr/lib/OLDsendmail.cf
X
X	$ cp sendmail.cf /usr/lib/sendmail.cf
X
X	$ /usr/lib/sendmail -bz
X
X	$ rm /bin/mail # (Remember, you still have it in /bin/lmail.)
X
X	$ mv svbinmail /bin/mail
X
X	$ mv /bin/rmail /bin/OLDrmail
X
X	$ ln /bin/smail /bin/rmail
X
X	Note: some implementations of sendmail don't work when the 'U'
X	flag is set in the definition of the local mailer (a line that
X	begins with "Mlocal" in the generated sendmail.cf).  If you try
X	to send mail from a local user to a local user, a message comes
X	out that says "No '!' in UUCP! (user)" - and the mail fails.
X	If this happens take the 'U' flag out of the sendmail.cf.
X
X	[ the >'s are secondary prompts from the shell,
X	  and ^M is 'carat' 'M', not 'control-M' ]
X
X	$ ed sendmail.cf <<!
X	> /^Mlocal/s/SU/S/
X	> w
X	> q
X	> !
X
X(3) For a System V system without sendmail, the steps are:
X
X	$ make
X
X	$ cp smail /bin/smail
X
X	$ mv /bin/mail /bin/lmail
X
X	$ mv svbinmail /bin/mail
X
X	$ mv /bin/rmail /bin/OLDrmail
X
X	$ ln /bin/smail /bin/rmail
X
XYou're done.
X
X#
X# @(#)Install	2.5 (smail) 9/15/87
X#
END_OF_FILE
if test 2181 -ne `wc -c <'mailer/Install'`; then
    echo shar: \"'mailer/Install'\" unpacked with wrong size!
fi
# end of 'mailer/Install'
fi
if test -f 'mailer/getopt.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'mailer/getopt.c'\"
else
echo shar: Extracting \"'mailer/getopt.c'\" \(2468 characters\)
sed "s/^X//" >'mailer/getopt.c' <<'END_OF_FILE'
X/*
X**	@(#)getopt.c	2.5 (smail) 9/15/87
X*/
X
X/*
X * Here's something you've all been waiting for:  the AT&T public domain
X * source for getopt(3).  It is the code which was given out at the 1985
X * UNIFORUM conference in Dallas.  I obtained it by electronic mail
X * directly from AT&T.  The people there assure me that it is indeed
X * in the public domain.
X * 
X * There is no manual page.  That is because the one they gave out at
X * UNIFORUM was slightly different from the current System V Release 2
X * manual page.  The difference apparently involved a note about the
X * famous rules 5 and 6, recommending using white space between an option
X * and its first argument, and not grouping options that have arguments.
X * Getopt itself is currently lenient about both of these things White
X * space is allowed, but not mandatory, and the last option in a group can
X * have an argument.  That particular version of the man page evidently
X * has no official existence, and my source at AT&T did not send a copy.
X * The current SVR2 man page reflects the actual behavor of this getopt.
X * However, I am not about to post a copy of anything licensed by AT&T.
X */
X
X/* This include is needed only to get "index" defined as "strchr" on Sys V. */
X#include "defs.h"
X
X/*LINTLIBRARY*/
X#define NULL	0
X#define EOF	(-1)
X#define ERR(s, c)	if(opterr){\
X	extern int write();\
X	char errbuf[2];\
X	errbuf[0] = c; errbuf[1] = '\n';\
X	(void) write(2, argv[0], (unsigned)strlen(argv[0]));\
X	(void) write(2, s, (unsigned)strlen(s));\
X	(void) write(2, errbuf, 2);}
X
Xextern char *index();
X
Xint	opterr = 1;
Xint	optind = 1;
Xint	optopt;
Xchar	*optarg;
X
Xint
Xgetopt(argc, argv, opts)
Xint	argc;
Xchar	**argv, *opts;
X{
X	static int sp = 1;
X	register int c;
X	register char *cp;
X
X	if(sp == 1)
X		if(optind >= argc ||
X		   argv[optind][0] != '-' || argv[optind][1] == '\0')
X			return(EOF);
X		else if(strcmp(argv[optind], "--") == NULL) {
X			optind++;
X			return(EOF);
X		}
X	optopt = c = argv[optind][sp];
X	if(c == ':' || (cp=index(opts, c)) == NULL) {
X		ERR(": illegal option -- ", c);
X		if(argv[optind][++sp] == '\0') {
X			optind++;
X			sp = 1;
X		}
X		return('?');
X	}
X	if(*++cp == ':') {
X		if(argv[optind][sp+1] != '\0')
X			optarg = &argv[optind++][sp+1];
X		else if(++optind >= argc) {
X			ERR(": option requires an argument -- ", c);
X			sp = 1;
X			return('?');
X		} else
X			optarg = argv[optind++];
X		sp = 1;
X	} else {
X		if(argv[optind][++sp] == '\0') {
X			sp = 1;
X			optind++;
X		}
X		optarg = NULL;
X	}
X	return(c);
X}
END_OF_FILE
if test 2468 -ne `wc -c <'mailer/getopt.c'`; then
    echo shar: \"'mailer/getopt.c'\" unpacked with wrong size!
fi
# end of 'mailer/getopt.c'
fi
if test -f 'mailer/getpath.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'mailer/getpath.c'\"
else
echo shar: Extracting \"'mailer/getpath.c'\" \(2234 characters\)
sed "s/^X//" >'mailer/getpath.c' <<'END_OF_FILE'
X#ifndef lint
Xstatic char 	*sccsid="@(#)getpath.c	2.5 (smail) 9/15/87";
X#endif
X
X# include	<stdio.h>
X# include	<sys/types.h>
X# include	<ctype.h>
X# include	"defs.h"
X
Xextern enum edebug debug;	/* how verbose we are 		*/ 
Xextern char *pathfile;		/* location of path database	*/
X
X/*
X**
X** getpath(): look up key in ascii sorted path database.
X**
X*/
X
Xgetpath( key, path , cost)
Xchar *key;		/* what we are looking for */
Xchar *path;		/* where the path results go */
Xint *cost;		/* where the cost results go */
X{
X	long pos, middle, hi, lo;
X	static long pathlength = 0;
X	register char *s;
X	int c;
X	static FILE *file;
X	int flag;
X
XDEBUG("getpath: looking for '%s'\n", key);
X
X	if(pathlength == 0) {	/* open file on first use */
X		if((file = fopen(pathfile, "r")) == NULL) {
X			(void) printf("can't access %s.\n", pathfile);
X			pathlength = -1;
X		} else {
X			(void) fseek(file, 0L, 2);	/* find length */
X			pathlength = ftell(file);
X		}
X	}
X	if( pathlength == -1 )
X		return( EX_OSFILE );
X
X	lo = 0;
X	hi = pathlength;
X	(void) strcpy( path, key );
X	(void) strcat( path, "\t" );
X/*
X** "Binary search routines are never written right the first time around."
X** - Robert G. Sheldon.
X*/
X	for( ;; ) {
X		pos = middle = ( hi+lo+1 )/2;
X		(void) fseek(file, pos, 0);	/* find midpoint */
X		if(pos != 0)
X			while(((c = getc(file)) != EOF) && (c != '\n'))
X				;	/* go to beginning of next line */
X		if(c == EOF) {
X			return(EX_NOHOST);
X		}
X		for( flag = 0, s = path; flag == 0; s++ ) { /* match??? */
X			if( *s == '\0' ) {
X				goto solved;
X			}
X			if((c = getc(file)) == EOF) {
X				return(EX_NOHOST);
X			}
X			flag = lower(c) - lower(*s);
X		} 
X		if(lo >= middle) {		/* failure? */
X			return(EX_NOHOST);
X		}
X		if((c != EOF) && (flag < 0)) {	/* close window */
X			lo = middle;
X		} else {
X			hi = middle - 1;
X		}
X	}
X/* 
X** Now just copy the result.
X*/
Xsolved:
X	while(((c  = getc(file)) != EOF) && (c != '\t') && (c != '\n')) {
X		*path++ = c;
X	}
X	*path = '\0';
X/*
X** See if the next field on the line is numeric.
X** If so, use it as the cost for the route.
X*/
X	if(c == '\t') {
X		int tcost = -1;
X		while(((c = getc(file)) != EOF) && isdigit(c)) {
X			if(tcost < 0) tcost = 0;
X			tcost *= 10;
X			tcost += c - '0';
X		}
X		if(tcost >= 0) *cost = tcost;
X	}
X	return (EX_OK);
X}
END_OF_FILE
if test 2234 -ne `wc -c <'mailer/getpath.c'`; then
    echo shar: \"'mailer/getpath.c'\" unpacked with wrong size!
fi
# end of 'mailer/getpath.c'
fi
if test -f 'mailer/make.cf.sh' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'mailer/make.cf.sh'\"
else
echo shar: Extracting \"'mailer/make.cf.sh'\" \(3037 characters\)
sed "s/^X//" >'mailer/make.cf.sh' <<'END_OF_FILE'
X#! /bin/sh
X#
X# @(#)make.cf.sh	2.5 (smail) 9/15/87
X#
Xcat <<!EOM!
XThis script will prompt you for the automatically configurable parameters
Xin the stock version of the sendmail configuration file.  Naturally, any
Xlocal extensions will have to be added manually.
X
XClyde is a VAX running AT&T System V Release 2.0, with a port of sendmail.
XClyde is a gateway for the domain .att.com.
X
XBelow is a trace of the session that
Xconfigured the sendmail.cf on clyde.ATT.COM:
X===
X
X!EOM!
X
Xecho "press return to continue"; read foo
X
Xcat <<!EOM!
XEnter Date (MM-DD-YY):
X06-24-86
XEnter This Host's Name:
Xclyde
XEnter This Host's Official Domain:
XATT.COM
XEnter Any Equivalent Domain Classes:
XATT
XEnter Any Domains For Which This Host Is An Authority:
XATT.UUCP
XDoes This Host Have SMTP Connections (y/n)?
Xno
XEnter Full Path to Executable That Will Provide Local Mail Delivery:
X/bin/lmail
XIs /bin/lmail A Berkeley Mailer [i.e., use -r to specify sender] (y/n)?
Xno
XWill This Host Act As A Gateway Between Domains (y/n)?
Xyes
XAre subdomains beneath this hosts' domain to be hidden (y/n)?
Xyes
X===
X!EOM!
X# get date of configuration
XCF_DATE=`/bin/sh ./smail.prompt string "Enter Date (MM-DD-YY):"`
X
X# get host name
XCF_HOST=`/bin/sh ./smail.prompt string "Enter This Host's Name:"`
X
X# get host domain
XCF_DOMAIN=`/bin/sh ./smail.prompt string "Enter This Host's Official Domain:"`
X
X# get domain classes
XCF_DCLASS=`/bin/sh ./smail.prompt string "Enter Any Equivalent Domain Classes:"`
X
X# get domain authority
XCF_AUTHORITY=`/bin/sh ./smail.prompt string "Enter Any Domains For Which This Host Is An Authority:"`
X
XCF_SMTP=`/bin/sh ./smail.prompt yesno "Does This Host Have SMTP Connections (y/n)?"`
Xif test "$CF_SMTP" = "yes"
Xthen
X
X#get list of local SMTP connections
X	CF_SMTP=`/bin/sh ./smail.prompt file "Enter Full Path to File that Contains List of SMTP Connections:"`
X
X	CF_SMTP="FE$CF_SMTP %s"
Xelse
X	CF_SMTP=""
Xfi
X
X# get path to local delivery agent
XCF_LOCALMAIL=`/bin/sh ./smail.prompt file "Enter Full Path to Executable That Will Provide Local Mail Delivery:"`
X
XCF_SYSTEM=`/bin/sh ./smail.prompt yesno "Is $CF_LOCALMAIL A Berkeley Mailer [i.e., use -r to specify sender] (y/n)?"`
Xif test "$CF_SYSTEM" = "yes"
Xthen
X	CF_SVMAIL="#"
X	CF_BSMAIL=""
Xelse
X	CF_SVMAIL=""
X	CF_BSMAIL="#"
Xfi
X
XCF_GATEWAY=`/bin/sh ./smail.prompt yesno "Will This Host Act As A Gateway Between Domains(y/n)?"`
Xif test "$CF_GATEWAY" = "yes"
Xthen
X	CF_GATEWAY=""
Xelse
X	CF_GATEWAY="#"
Xfi
X
XCF_HIDDENHOSTS=`/bin/sh ./smail.prompt yesno "Are subdomains beneath this hosts' domain to be hidden (y/n)?"`
Xif test "$CF_HIDDENHOSTS" = "yes"
Xthen
X	CF_HIDDENHOSTS=""
Xelse
X	CF_HIDDENHOSTS="#"
Xfi
X
Xsed 	\
X	-e "s/CF_HOST/Dw$CF_HOST/" \
X	-e "s/CF_DOMAIN/DD$CF_DOMAIN/" \
X	-e "s/CF_AUTHORITY/DA$CF_AUTHORITY/" \
X	-e "s/CF_DCLASS/CDUUCP $CF_DCLASS/" \
X	-e "s;CF_SMTP;$CF_SMTP;" \
X	-e "s;CF_DATE;$CF_DATE;" \
X	-e "s;CF_LOCALMAIL;$CF_LOCALMAIL;" \
X	-e "s;CF_BSMAIL;$CF_BSMAIL;" \
X	-e "s;CF_SVMAIL;$CF_SVMAIL;" \
X	-e "s;CF_GATEWAY;$CF_GATEWAY;" \
X	-e "s;CF_HIDDENHOSTS;$CF_HIDDENHOSTS;" \
X	template.cf > sendmail.cf
END_OF_FILE
if test 3037 -ne `wc -c <'mailer/make.cf.sh'`; then
    echo shar: \"'mailer/make.cf.sh'\" unpacked with wrong size!
fi
# end of 'mailer/make.cf.sh'
fi
if test -f 'mailer/map.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'mailer/map.c'\"
else
echo shar: Extracting \"'mailer/map.c'\" \(1360 characters\)
sed "s/^X//" >'mailer/map.c' <<'END_OF_FILE'
X#ifndef lint
Xstatic char 	*sccsid="@(#)map.c	2.5 (smail) 9/15/87";
X#endif
X
X# include	<stdio.h>
X# include	<sys/types.h>
X# include	"defs.h"
X
Xextern int queuecost;
X
X/*
X**
X**  map(): map addresses into <host, user, form, cost> sets.
X**
X**  Calls resolve() for each address of argv.  The result is hostv and 
X**  userv arrays (pointing into buffers userz and hostz), and formv array.
X**
X*/
X
Xmap(argc, argv, hostv, userv, formv, costv)
Xint argc;				/* address count 		*/
Xchar **argv;				/* address vector 		*/
Xchar *hostv[];				/* remote host vector 		*/
Xchar *userv[];				/* user name vector 		*/
Xenum eform formv[];			/* address format vector 	*/
Xint costv[];				/* cost vector 			*/
X{
X	int i, cost;
X	enum eform resolve();
X	char *c;
X	static char userbuf[BIGBUF], *userz;
X	static char hostbuf[BIGBUF], *hostz;
X
X	userz = userbuf;
X	hostz = hostbuf;
X
X	for( i=0; i<argc; i++ ) {
X#ifdef DEFQUEUE
X		cost = queuecost+1;		/* default is queueing */
X#else
X		cost = queuecost-1;		/* default is no queueing */
X#endif
X		userv[i] = userz;		/* put results here */
X		hostv[i] = hostz;
X		if ( **argv == '(' ) {		/* strip () */
X			++*argv;
X			c = index( *argv, ')' );
X			if (c)
X				*c = '\0';
X		}
X						/* here it comes! */
X		formv[i] = resolve(*argv++, hostz, userz, &cost);
X		costv[i] = cost;
X		userz += strlen( userz ) + 1;	/* skip past \0 */
X		hostz += strlen( hostz ) + 1;
X	}
X}
END_OF_FILE
if test 1360 -ne `wc -c <'mailer/map.c'`; then
    echo shar: \"'mailer/map.c'\" unpacked with wrong size!
fi
# end of 'mailer/map.c'
fi
if test -f 'mailer/nptx.8' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'mailer/nptx.8'\"
else
echo shar: Extracting \"'mailer/nptx.8'\" \(1410 characters\)
sed "s/^X//" >'mailer/nptx.8' <<'END_OF_FILE'
X.TH NPTX 8
X.tr ~
X.SH NAME
Xnptx \- full name permutations
X.SH SYNOPSIS
X.B nptx
X.SH DESCRIPTION
X.I nptx
Xreads a list of address name pairs on the standard
Xinput and prints name permutations and the address
Xpairs on the standard output.
Xnptx is generally used in generation of a full name
Xdatabase for
X.IR smail (8).
XThe format of an input line is
X.sp
X.ce
Xaddress	name
X.sp
XThe address field can contain any address, it is terminated by
Xa TAB char (ascii 0x9).  No translation is done on the field.
XThe name field consists of whitespace separated names or initials
Xwith an optional nickname given in parentheses, it is terminated
Xby either a newline ascii (0xA) or a ',' (ascii 0x).  All permutations
Xof the names and initials are printed.  The only restriction is
Xthat the last name will appear in each permutation.  The permutations
Xare not necesarily unique.
X.SH EXAMPLES
X.nf
X.in +5
X$ echo "gpb@ECH.gatech.edu\tWrecker Burdell(George P.)"|nptx
XBurdell	gpb@ECH.gatech.edu
XW.Burdell	gpb@ECH.gatech.edu
XWrecker.Burdell	gpb@ECH.gatech.edu
XBurdell	gpb@ECH.gatech.edu
XG.Burdell	gpb@ECH.gatech.edu
XGeorge.Burdell	gpb@ECH.gatech.edu
XP.Burdell	gpb@ECH.gatech.edu
XP.Burdell	gpb@ECH.gatech.edu
XG.P.Burdell	gpb@ECH.gatech.edu
XGeorge.P.Burdell	gpb@ECH.gatech.edu
XG.P.Burdell	gpb@ECH.gatech.edu
XGeorge.P.Burdell	gpb@ECH.gatech.edu
X$
X.in
X.SH SEE ALSO
Xsmail(8), paths(8), mkfnames(8)
X.SH VERSION
X@(#)nptx.8	2.5 (smail) 9/15/87
END_OF_FILE
if test 1410 -ne `wc -c <'mailer/nptx.8'`; then
    echo shar: \"'mailer/nptx.8'\" unpacked with wrong size!
fi
# end of 'mailer/nptx.8'
fi
if test -f 'mailer/patch.dotname' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'mailer/patch.dotname'\"
else
echo shar: Extracting \"'mailer/patch.dotname'\" \(2308 characters\)
sed "s/^X//" >'mailer/patch.dotname' <<'END_OF_FILE'
XFrom inco!hadron!decuac!haven!aplcen!samsung!usc!snorkelwacker!husc6!bu-cs!mirror!necntc!dbd Fri Nov 10 11:53:32 EST 1989
XArticle 671 of comp.mail.uucp:
XPath: alembic!inco!hadron!decuac!haven!aplcen!samsung!usc!snorkelwacker!husc6!bu-cs!mirror!necntc!dbd
X>From: dbd@necntc.nec.com (Dave Davidian)
XNewsgroups: comp.mail.uucp
XSubject: smail 2.5 patch for a dotted hostname
XKeywords: re-posted here from comp.sources.bugs
XMessage-ID: <28383@necntc.nec.com>
XDate: 8 Nov 89 21:54:05 GMT
XOrganization: NEC Electronics Inc.  Natick, MA 01760
XLines: 61
XFollow-ups: comp.mail.uucp
X
X
X	SMAIL 2.5 PATCH FOR A DOTTED HOST NAME
X
XI am posting this smail 2.5 patch for all to use as appropriate.
X
XI am making no claimes as to whether there should or should not be a
X"." in a host name. However, this patch works.
X
XThe source of this patch is from cs.utexas.edu and was forwarded from
Xbu.edu to urartu.sdpa.org (which talks to bu.edu) and was subsequently
Xtested for several days.
X
Xnote: the paths file entry for such a case would be:
X
Xxy.edu	xy.edu!%s	#which would make smail abort or revert to a
X			#smart-host if in domain format (if you are
X			#lucky)
X	
X				- - -
X
XThe problem, as I understand it, is that smail 2.5 wants to treat a
Xdotted UUCP hostname (such as cs.utexas.edu or bu.edu) as a domain and
Xnot a host.  And it apparently must resolve addresses to a host
Xand not a domain before it will deliver.  I think smail 2.5 is broken 
Xin this regard. 
X
XRFC976 is ambiguous on this.  However, Mel Pleasant and the UUCP Project
Xhave officially blessed dotted UUCP names such as ours.  I doubt
Xthat any future software will have this restriction (and I know that
Xsmail 3+ does not).
X
XHere's a patch which we hand out to all our smail 2.5 peers.
X
X
X*** headers.c.old	Fri May 27 09:19:59 1988
X--- headers.c	Fri May 27 09:27:50 1988
X***************
X*** 148,153 ****
X--- 148,161 ----
X  			return(UUCP);
X  		}
X  
X+ 		{
X+ 		char path[SMLBUF];
X+ 		int cost;
X+ 
X+ 		if(getpath(domain, path, &cost) == EX_OK)
X+ 			return(UUCP);
X+ 		}
X+ 
X  		if(partv[parts-1][0] == '\0') {
X  			partv[parts-1][-1] = '\0'; /* strip trailing . */
X  		}
X
X
X
X-- 
XDavid Davidian	              |		dbd@necntc.nec.com	
X			      |		..harvard!necntc!dbd
XFacts are facts, in my        |		dbd@urartu.sdpa.org
Xemployer's opinion.	      |		..bu.edu!urartu!dbd
X
X
END_OF_FILE
if test 2308 -ne `wc -c <'mailer/patch.dotname'`; then
    echo shar: \"'mailer/patch.dotname'\" unpacked with wrong size!
fi
# end of 'mailer/patch.dotname'
fi
if test -f 'mailer/paths.8' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'mailer/paths.8'\"
else
echo shar: Extracting \"'mailer/paths.8'\" \(2860 characters\)
sed "s/^X//" >'mailer/paths.8' <<'END_OF_FILE'
X.TH PATHS 8
X.tr ~
X.SH NAME
Xpaths \- smail routing database
X.SH DESCRIPTION
XThe
X.I paths
Xfile is the routing database for
X.IR smail .
XEach line of the file provides routing information
Xto either a host or to a domain.  Each line should
Xhave either two or three tab (ascii~0x9) separated fields.
XThe format of each line in the paths file is:
X.tr ~
X.sp
X.ce
X\fIkey~~route~~~[cost]\fP
X.sp
XThe
X.I key
Xfield is the key on which searches are performed.
XTypically this is either a UUCP host name or a domain name.
X.I smail
Xuses a binary search algorithm when searching the database,
Xso the keys must be sorted in ascending order.
XCase is ignored when searching, so the keys should be converted
Xto lower case before sorting (see
X.IR lcase (8)
Xand
X.IR pathproc (8)).
X.B Warning:
XThere is a bug in
X.I sort -f,
Xso don't use it.  Convert the keys to lower case, and then sort.
X.PP
XThe
X.I route
Xfield is a "printf" string that details the route that mail to the
X.I key
Xshould take.
XSee
X.I pathalias
Xdocumentation for details.
X.PP
XThe optional
X.I cost
Xfield is used by
X.I smail
Xto determine whether to simply queue outbound
XUUCP mail, or to attempt immediate delivery
X(usually by invoking
X.IR uucico ).
XIf the cost field is present, and the value is at or below
X.IR smail "'s"
X.I queueing threshold
Xthen the mail will be queued and an attempt at immediate delivery
Xwill be made.  This will speed mail delivery between hosts who
Xenjoy a cheap uucp link, like a hardwired line or some other
Xlow cost transport medium, while allowing mail sent over more
Xexpensive media to accumulate before transmission.
XIf the field is absent, the cost defaults to a value
Xabove the
X.I queueing threshold.
XThe default value for the queueing threshold is equal to the pathalias
Xcost DEDICATED+LOW.  Thus, direct links with cost DEDICATED+LOW or less
Xwill see immediate delivery, while the others are queued for later delivery.
X.SH EXAMPLE
XHere's a sample paths file for a small host, like a pc, that doesn't
Xwant to maintain complete routing information.  It illustrates
Xmost of the aspect of the
X.I paths
Xfile.  Assme that the pc's name is
X.I mypc,
Xand that it's in domain
X.I .mydomain.
XAlso, assume that it has a dedicated link to
Xa smart host named
X.I bighub,
Xand that
X.IR bighub 's
Xadministrator has given
X.I mypc
X.B permission
Xto use
X.I bighub
Xas a mail relay.
XLastly, assume that
X.I mypc
Xhas a dialed on demand link to another computer named
X.I friend.
X.nf
X.sp
X.in +5
X\fIpathalias\fP input
X.sp
X mypc =	.mypc.mydomain
X mypc friend(DEMAND), bighub(DEDICATED)
X smart-host = bighub
X.sp
X\fIpaths\fP file produced by \fIpathalias -f inputfile|pathproc\fP
X.sp
X .mypc.mydomain	%s	0
X bighub	bighub!%s	95
X friend	friend!%s	300
X mypc	%s	0
X smart-host	bighub!%s	95
X.in
X.sp
X.fi
X.SH SEE ALSO
Xpathalias - by Peter Honeyman
X.br
Xsmail(8), lcasep(8), pathproc(8)
X.SH VERSION
X@(#)paths.8	2.5 (smail) 9/15/87
END_OF_FILE
if test 2860 -ne `wc -c <'mailer/paths.8'`; then
    echo shar: \"'mailer/paths.8'\" unpacked with wrong size!
fi
# end of 'mailer/paths.8'
fi
if test -f 'mailer/svbinmail.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'mailer/svbinmail.c'\"
else
echo shar: Extracting \"'mailer/svbinmail.c'\" \(1684 characters\)
sed "s/^X//" >'mailer/svbinmail.c' <<'END_OF_FILE'
X#ifndef lint
Xstatic char	*sccsid = "@(#)svbinmail.c	2.5 (smail) 9/15/87";
X#endif
X/* */
X/* This program will be used in place of /bin/mail on SVR2 sites.
X/* It looks at the arguments and decides whether to call
X/* SENDER for sending mail, or READER for reading mail.
X/*
X/* before installing as /bin/mail, move the stock /bin/mail to /bin/lmail
X/*
X/*  */
X
X#include <stdio.h>
X#include "defs.h"
X
X#ifdef SENDMAIL
X#define SENDER	SENDMAIL
X#else
X#define	SENDER	"/bin/rmail"
X#endif
X
X#define	READER	"/bin/lmail"
X
X#define TRUE 1
X#define FALSE 0
X
Xchar prog[128];
X
Xvoid	perror(), exit(), usage();
X
Xmain(argc, argv)
Xint argc;
Xchar *argv[];
X{
X	extern int optind;
X	extern char *optarg;
X
X	int i, j, c;
X	int reading, sending;
X
X	reading = sending = FALSE;
X
X	(void) strcpy(prog, argv[0]);
X
X	if(argc == 1) {
X		reading = TRUE;
X	} else {
X		while((c = getopt(argc, argv, "epqrtf:")) != EOF) {
X			switch(c) {
X			case 'e':
X			case 'p':
X			case 'q':
X			case 'r':
X			case 'f':
X				reading = TRUE;
X				break;
X			case 't':
X				sending = TRUE;
X				break;
X			default:
X				usage();
X				return(1);
X			}
X		}
X	}
X
X	/* any arguments left over -> sending */
X	if(argc > optind) {
X		sending = TRUE;
X	}
X
X	if((reading == TRUE) && (sending == TRUE)) {
X		usage();
X		return(1);
X	}
X
X	if(sending == TRUE) {
X		argv[0] = SENDER;
X		for(i = 1, j = optind; j < argc; i++, j++) {
X			argv[i] = argv[j];
X		}
X		argv[i] = NULL;
X	} else {
X		argv[0] = READER;
X	}
X
X	(void) execvp(argv[0], argv);
X	(void) fprintf(stderr, "%s: execvp(\"%s\", argv) failed: ",
X		prog, argv[0]);
X	perror("");
X	return(1);
X}
X
Xvoid
Xusage()
X{
X	(void) fprintf(stderr, "usage:\t%s [ -epqr ] [ -f file ]\n", prog);
X	(void) fprintf(stderr, "\t%s [ -t ] persons\n", prog);
X}
END_OF_FILE
if test 1684 -ne `wc -c <'mailer/svbinmail.c'`; then
    echo shar: \"'mailer/svbinmail.c'\" unpacked with wrong size!
fi
# end of 'mailer/svbinmail.c'
fi
echo shar: End of archive 2 \(of 8\).
cp /dev/null ark2isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 8 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